Compound Interest Calculator 2.5 Years
After ' + years + ' years, at an interest rate of ' + (rate * 100) + '%, with an initial investment of $' + principal.toFixed(2) + ', you will have $' + amount.toFixed(2) + '.
'; resultElement.innerHTML += 'Total interest earned: $' + interest.toFixed(2) + '
'; }