Calculator Money

Money Calculator

Calculate how different amounts of money can grow or change over time based on various inputs.

Calculation Details

function calculateMoney() { const initialAmount = parseFloat(document.getElementById(‘initialAmount’).value); const interestRate = parseFloat(document.getElementById(‘interestRate’).value) / 100; const timePeriod = parseFloat(document.getElementById(‘timePeriod’).value); if (isNaN(initialAmount) || isNaN(interestRate) || isNaN(timePeriod)) { alert(‘Please enter valid values.’); return; } const finalAmount = initialAmount * Math.pow(1 + interestRate, timePeriod); document.getElementById(‘finalAmount’).value = finalAmount.toFixed(2); const details = ` Initial Amount: $${initialAmount}
Interest Rate: ${interestRate * 100}%
Time Period: ${timePeriod} years
Final Amount: $${finalAmount.toFixed(2)} `; document.getElementById(‘details’).innerHTML = details; document.getElementById(‘calculationDetails’).style.display = ‘block’; }

Leave a Reply

Your email address will not be published. Required fields are marked *