I am trying to work on a scenario where a user enters a monthly income and receives future value with a compound interest in 30 years. As of now, I have assigned some values ββfor testing.
var investment = 800;
var annualRate = 2;
var monthlyRate = annualRate / 12 / 100;
var years = 30;
var months = years * 12;
var futureValue = 0;
for ( i = 1; i <= months; i++ ) {
futureValue = futureValue + investment * Math.pow(1 + monthlyRate, months);
}
The problem is that I actually build this from an Excel spreadsheet that uses the built-in FV () formula and when cross-checking, my results are completely disabled ... Any idea what I'm doing wrong, since I'm not in financial math at all . Thanks in advance.
source
share