These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Complex formula for form fields

TM921
Registered: Apr 14 2009
Posts: 11

I'm trying to do the following complex formula. I want to be able to calculate tInterest (Total Interest Due) = fDays (# of days) * .0002739726 (interest rate) * PrincipalAmt (principal) but ONLY IF fDays > 90 or if CheckBox1 is checked then fDays > 180, otherwise tInterest = 0.

See, I'm trying to create a form for my state judiciary where the bond forfeiture amount is to be calculated. Interest is only to be calculated on the bond amount from the fail to appear date (StartDate) if 90 days has elapsed OR 180 days has elapsed if an extension was granted. Either way, interest is to be calculated from StartDate.

Is this possible?

TM921
Registered: Apr 14 2009
Posts: 11
I've come up with the following, but it is not working. Any suggestions?


var tInterest = 0; // the default
if ((fDays >= 90) && (fDays <=180)) {
tInterest = fDays * .0002739726 * PrincipalAmt ;
}
else if ((fdays > 180) && (document.getElementById("checkBox1").checked)) {
tInterest = fDays * .0002739726 * PrincipalAmt ;
}
tInterest = tInterest.toFixed(2); // result to 2 decimal places