Form Control JavaScript DHTML



Compound Interest Calculator

function calculate(formObj)
{
     var presentVal = parseFloat(formObj.presentVal.value);
     var intRate = parseFloat(formObj.intRate.value)/100.;
     var years = parseFloat(formObj.years.value);
   
     var futureVal = presentVal * Math.pow((1.0+intRate),years);
     var totalInt = futureVal - presentVal;
     futureVal = Math.round(futureVal*100.0)/100.0;
     totalInt  = Math.round(totalInt*100.0)/100.0;
   
     formObj.futureVal.value = futureVal;
     formObj.totalInt.value = totalInt;
   
     return;
}


   

Compound Interest Calculator




Present Value:        
Interest Rate(%):     
Years of Compounding: 





Total Interest: 
Future Value: