You want to calculate how large a loan you can get assuming you make a given monthly payment.

Calculate the present value of a series of equal future periodic
payments using the custom `Math.PV( )`

function.

Suppose you are a bank with a big pile of money and you want to lend it to someone to earn some interest. The borrower might come to you and say, “I can pay you back $1,000 per month for 30 years. How much money will you loan me?” The answer requires you to calculate how much the money that you will receive at various times in the future (as a series of periodic payments) is worth today.

The following custom `Math.PV( )`

function returns
the same value as the one obtained in Microsoft Excel using the
Insert → Function → Financial
→ PV formula. You can add this to your
`Math.as`

file for easy inclusion in other
projects.

Math.PV = function (i, n, PMT) { //= periodic interest rate //`i`

= number of payment periods //`n`

= periodic payment // Present value compounded over`PMT`

periods: //`n`

=`PV`

* ( (`PMT`

-1)/(`multiplier`

*`i`

)) // where`multiplier`

=`multiplier`

((1 +`Math.pow`

),`i`

) multiplier = Math.pow ((1 + i), n); PV = PMT * (multiplier-1) / (i*multiplier); return PV; };`n`

You can use the custom `Math.PV( )`

method as
follows:

// How much will the bank loan me if I can pay $1000/month for 30 years (6% rate)? trace (Math.PV(.06/12, 30*12, 1000));

Recipe 5.6, Recipe 5.16, Recipe 5.17, and Recipe 5.19. You can consult ...

Start Free Trial

No credit card required