PMT in Javascript

前端 未结 4 1801
无人及你
无人及你 2021-01-13 19:15

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 -          


        
4条回答
  •  难免孤独
    2021-01-13 19:31

    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 :)

提交回复
热议问题