Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. function calcCompoundInterest([p, i, n, t]) {
  2. [p, i, n, t] = [p, i, n, t].map(Number);
  3.  
  4. let compoundInterest = p * Math.pow(1 + i / ((n/12) * 100), (n * t) / 12);
  5. console.log(compoundInterest.toFixed(2));
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement