Advertisement
Guest User

Untitled

a guest
Jun 27th, 2012
1,042
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. PMT function in Javascript
  2. interest_rate : the interest rate for the loan.
  3. number_payments : the number of payments for the loan.
  4. PV : the present value or principal of the loan.
  5. FV : It is the future value or the loan amount outstanding after all payments have been made.
  6.  
  7. Type is : It indicates when the payments are due. Type can be one of the following values:
  8. 0, 1
  9.  
  10. function PMT (ir, np, pv, fv ) {
  11. /*
  12. ir - interest rate per month
  13. np - number of periods (months)
  14. pv - present value
  15. fv - future value (residual value)
  16. */
  17. pmt = ( ir * ( pv * Math.pow ( (ir+1), np ) + fv ) ) / ( ( ir + 1 ) * ( Math.pow ( (ir+1), np) -1 ) );
  18. return pmt;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement