Výpočet složeného úročení


<script type="text/javascript">
 
// Define principal and term of loan
var p = 10000;
var t = 10;
 
// Calculate the interest rate for loan
var r = Math.pow(1 + (0.05 / 12), 12 * t) - 1;
 
// Calculate compound interest
var ci = p * Math.pow(1 + r, t);
 
// Display compound interest in #result
document.getElementById("result").innerHTML = "Compound Interest : $"+Math.round(ci);
 
</script>