如何制作共同基金 - SIP 计算器?

Pra*_*ane 2 html javascript sip calculator

我正在为网站/博客制作一个 SIP 计算器。但不知道应该如何开始。我已经创建了一个基本的 html CSS 版本,但不知道如何计算数字。

Pra*_*tal 5

  var investment = 800; //principal amount
  var annualRate = 2; 
  var monthlyRate = annualRate / 12 / 100;  //Rate of interest
  var years = 30; 
  var months = years * 12;  //Time period 
  var futureValue = 0; //Final Value

  futureValue = investment * (Math.pow(1 + monthlyRate, months) - 1) / 
monthlyRate;
Run Code Online (Sandbox Code Playgroud)

SIP只不过是本金的复利金额。