Tag: 速率

财务费率函数在JavaScript不能正常工作

在简单的财务费率函数中给出的函数在javascript中并没有给我和excel函数一样的答案。 对于http://allfinancialmatters.com/2009/11/03/how-to-use-the-rate-function-in-excel/给出的问题,对于我的testing用例来说,它是完美的。 其结果不同于excel率。 这是奇怪的行为。 我无法解决这个问题。 我的testing用例(用excel输出)是 RATE(360,-665.3, 99000) = 0.0059 RATE(360,-958.63, 192000) =0.0036 RATE(180,-1302.96,192000) = 0.0023 RATE(360, -889.19, 192000) =0.00312 RATE(360, -1145.8, 240000) = 0.0033 我的code.js是 function rate(paymentsPerYear, paymentAmount, presentValue, futureValue, dueEndOrBeginning, interest) { //If interest, futureValue, dueEndorBeginning was not set, set now //if (interest == null) // not working here 😀 if (isNaN(interest)) interest […]