NPS Calculator | The Wealth Blog

NPS Calculator

:root{–background-color:#fff;–vigo-color:#2bbd3e;–slider-color:#2bbd3e;–input-number-color:#e7e5e5b7}*{box-sizing:border-box}.calcform{display:flex;justify-content:center;align-items:center;background-color:var(–background-color);color:#222}#amountLabel{width:210px}.sip-calculator{border:5px solid #fff;-moz-box-shadow:0 0 5px hsla(12,2%,55%,0.527);-webkit-box-shadow:0 0 5px hsl(15,2%,55%);box-shadow:0 0 10px hsl(0,0%,73.9%);padding:3em;margin:1em;width:530px;background-color:#fff}.sip-calculator-amount,.sip-calculator-year,.sip-calculator-roi{margin-bottom:2.2em;width:100%}.amount-slider,.year-slider,.roi-slider{width:100%;height:2px;border-radius:10px;background:var(–slider-color);outline:0}input[type=”range”]{-moz-appearance:none;-webkit-appearance:none;appearance:none;cursor:pointer}input[type=”range”]:focus{outline:0}input[type=”range”]::-ms-track{width:100%;cursor:pointer}input[type=”range”]::-webkit-slider-thumb{-webkit-appearance:none;border:2.5px solid var(–vigo-color);height:20px;width:20px;border-radius:40px;background:white;cursor:pointer;margin-top:0}input[type=”range”]::-moz-range-thumb{border:2.5px solid var(–vigo-color);height:20px;width:20px;border-radius:40px;background:white;cursor:pointer}input[type=”range”]::-ms-thumb{border:2.5px solid var(–vigo-color);height:20px;width:20px;border-radius:40px;background:white;cursor:pointer}input[type=”number”]{-moz-appearance:none;-webkit-appearance:none;cursor:pointer;background:var(–input-number-color);border-style:none;height:30px;margin-left:20px;margin-right:10px;text-align:right;padding-right:5px;font-family:”Roboto”,sans-serif;font-size:1.5em;border-radius:4px}input[type=”number”]:focus{outline:0;border:1px solid #3197ee}.radio{margin:.5rem;text-align:center}.radio input[type=”radio”]{position:absolute;opacity:0}.radio input[type=”radio”]+.radio-label:before{content:””;background:#f4f4f4;border-radius:100%;border:2px solid #2bbd3e;display:inline-block;width:1.4em;height:1.4em;position:relative;top:-0.2em;margin-right:1em;vertical-align:top;cursor:pointer;text-align:center;transition:all 250ms ease}.radio input[type=”radio”]:checked+.radio-label:before{background-color:#2bbd3e;box-shadow:inset 0 0 0 4px #f4f4f4}.radio input[type=”radio”]:focus+.radio-label:before{outline:0;border-color:#3197ee}.radio input[type=”radio”]:disabled+.radio-label:before{box-shadow:inset 0 0 0 4px #f4f4f4;border-color:#b4b4b4;background:#b4b4b4}.radio input[type=”radio”]+.radio-label:empty:before{margin-right:0}@media only screen and (max-width:325px){.sip-calculator{height:560px}h1{font-size:1.5em}}@media(max-width:576px){body{font-size:smaller}.sip-calculator{width:100%;padding:2em;margin:.1em}}

NPS Calculator

Rs.

Years

%

Total Investment:

Interest Earned:

Maturity Amount:

Annuity Investment:

“use strict”;var investmentPerMonthSlider=document.getElementById(“myInvestmentPerMonthAmount”);var investmentPerMonthOutput=document.getElementById(“inputInvestmentPerMonth”);var ageSlider=document.getElementById(“myAge”);var ageOutput=document.getElementById(“inputAge”);var expectedReturnsSlider=document.getElementById(“myExpectedReturns”);var expectedReturnsOutput=document.getElementById(“inputExpectedReturns”);investmentPerMonthOutput.innerHTML=investmentPerMonthSlider.value;expectedReturnsOutput.innerHTML=expectedReturnsSlider.value;ageOutput.innerHTML=ageSlider.value;investmentPerMonthSlider.oninput=function(){investmentPerMonthOutput.innerHTML=this.value};expectedReturnsSlider.oninput=function(){expectedReturnsOutput.innerHTML=this.value};ageSlider.oninput=function(){ageOutput.innerHTML=this.value};function showInvestmentPerMonthAmount(a){investmentPerMonthSlider.value=a;calculateIt()}function showValRoi(a){expectedReturnsSlider.value=a;calculateIt()}function showValAge(a){ageSlider.value=a;calculateIt()}investmentPerMonthSlider.addEventListener(“input”,updateInvestmentPerMonthValue);ageSlider.addEventListener(“input”,updateAgeValue);expectedReturnsSlider.addEventListener(“input”,updateExpectedReturnsValue);function updateInvestmentPerMonthValue(a){investmentPerMonthOutput.value=a.srcElement.value;calculateIt()}function updateExpectedReturnsValue(a){expectedReturnsOutput.value=a.srcElement.value;calculateIt()}function updateAgeValue(a){ageOutput.value=a.srcElement.value;calculateIt()}function calculateIt(){var k=document.getElementById(“totalInvestment”);var i=document.getElementById(“interestEarned”);var f=document.getElementById(“maturityAmount”);var e=document.getElementById(“annuityInvestment”);var d=document.sipForm.realInvestmentPerMonthAmount.value;var j=document.sipForm.realAge.value;var c=document.sipForm.realExpectedReturns.value;console.log(d);console.log(j);console.log(c);var a=Math.round((d*12*(60-j))/100)*100;var g=Math.round((((d*(Math.pow(1+c/12/100,(60-j)*12)-1))/(c/12/100))*(1+c/12/100))/100)*100-Math.round((d*12*(60-j))/100)*100;var h=Math.round((((d*(Math.pow(1+c/12/100,(60-j)*12)-1))/(c/12/100))*(1+c/12/100)*0.6)/100)*100;var b=Math.round((((d*(Math.pow(1+c/12/100,(60-j)*12)-1))/(c/12/100))*(1+c/12/100)*0.4)/100)*100;k.innerHTML=”Rs. “+a.toLocaleString();i.innerHTML=”Rs. “+g.toLocaleString();f.innerHTML=”Rs. “+h.toLocaleString();e.innerHTML=”Rs. “+b.toLocaleString()}calculateIt();
Scroll to Top