Skip to content
Advertisement

financial rate function in javascript not working properly

the function given at simple financial rate function in javascript is not giving me same answers as excel rate function some time. It works perfectly for the problem given at http://allfinancialmatters.com/2009/11/03/how-to-use-the-rate-function-in-excel/ but for my test cases. its results are different from excel rate. this is strange behaviour. i am unable to sort this out. my test cases (with excel output) are

JavaScript

my code.js is

JavaScript

and my HTML file is

JavaScript

Advertisement

Answer

In case anyone is still looking for a javascript implementation of the Excel’s Rate function, this is what I came up with:

JavaScript

Testing the function with Abdul’s test cases give the following results:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement