I am trying to code the equivalent to the EXCEL PMT function.
in JavaScript, the formula looks like this:
function PMT (ir, np, pv, fv ) { /* ir -
I am not a math wiz, but a simple google search turned this thread up:
http://www.excelforum.com/excel-general/370948-pmt-function-does-anyone-know-the-formula.html
Here he has the following formula for type=0:
pmt = ((pv - fv) * ir / (1 - (1 + ir) ^ -(np)));
Maybe this will work for you :)