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

Need a loan calculation script

ricnic67
Registered: Oct 21 2009
Posts: 9

I need to create a script that will give me the monthly payment when someone types in the following:

-Loan amount (i.e. $89,995)
-APR (i.e. 6.99%)

The terms will be preset at 36, 60, 84, and 120 months.

The formula for calculating the payment amount is shown below.

r(1+r)n
A=P ------------
(1+r)n - 1

(the n is superscripted in this equation)

where
A = payment Amount per period (Monthly Payment)
P = initial Principal (Loan Amount)
r = interest rate per period (Annual Loan Rate / 12)
n = total number of payments or periods (Loan term expressed in Months)

Any help is appreciated.

thanks

My Product Information:
Acrobat Pro 8.1.6, Macintosh
Almir Santos
Registered: Oct 23 2009
Posts: 1
The monthly payment calculation is pure javascript, I would write something like this:

var A = 0; //monthly payment amountvar APR = 6.99; //Annual Percentage Ratevar r =  6.99/100/12; //interest rate per period (Annual Loan Rate / 12)var P = 89995; //Loan Amount -> it can come from a text field, for examplevar n = 36; //The terms will be preset at 36, 60, 84, and 120 months -> it can come from a combo box, for example A = P * (r * Math.pow(1 + r, n)) / (Math.pow(1 + r, n) - 1);

To test it in the console add the line:

console.println("A = " + A);
I compared with the Excell PMT function and got the same result.

Almir R. Venegas dos Santos
ACI (Adobe Certified Instructor)
ACE (Adobe Certified Expert)