【问题标题】:How to make Mutual Fund - SIP Calculator?如何制作共同基金 - SIP 计算器?
【发布时间】:2018-08-19 13:15:16
【问题描述】:

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

【问题讨论】:

标签: javascript html calculator sip


【解决方案1】:
  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;

SIP is nothing but just Compound interest amount on Principal amount.

【讨论】:

    【解决方案2】:
    $('#btn-sip').click(function(event) {
    
        var investment = $('#inv-amount').val(); // Total investment
        var years = $('#inv-period').val(); // No of years
        var annualRate = $('#inv-exreturn').val(); // annual Rate
    
            if (investment == '' || years == '' || annualRate == '') {
                alert('please enter all values');
            } else {
                var monthlyRate = annualRate / 12 / 100;
                var months = years * 12;
                var futureValue = 0;
    
            var total = ((investment*years*annualRate));
    
            futureValue=(investment * (1+monthlyRate) * ((Math.pow((1+monthlyRate),months)) - 1)/monthlyRate);
    
            $('#total-investment').val(Math.round(total));
            $('#end-value').val(Math.round(futureValue));
    
            $('#sip-cal-result').css('display', 'block');
            }
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-03
      • 2022-11-12
      • 2018-04-04
      • 2011-11-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多