Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function calcCompoundInterest([p, i, n, t]) {
- [p, i, n, t] = [p, i, n, t].map(Number);
- let compoundInterest = p * Math.pow(1 + i / ((n/12) * 100), (n * t) / 12);
- console.log(compoundInterest.toFixed(2));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement