<html> <head> <title>Compound Interest Calculator</title> <script language="JavaScript"> 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;