Skip to content function calculateSavings() {
var principal = parseFloat(document.getElementById('principal').value);
var rate = parseFloat(document.getElementById('rate').value) / 100;
var years = parseInt(document.getElementById('years').value);
var futureValue = principal * Math.pow(1 + (rate / 12), years * 12);
document.getElementById('result').innerText = '$' + futureValue.toFixed(2);
}