We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents ed3b2c0 + f17c07a commit 71688e7Copy full SHA for 71688e7
2 files changed
2-ui/4-forms-controls/3-events-change-input/1-deposit-calculator/solution.view/index.html
@@ -96,7 +96,7 @@
96
let years = form.months.value / 12;
97
if (!years) return;
98
99
- let result = Math.round(initial * (1 + interest * years));
+ let result = Math.round(initial * (1 + interest) ** years);
100
101
let height = result / form.money.value * 100 + 'px';
102
document.getElementById('height-after').style.height = height;
2-ui/4-forms-controls/3-events-change-input/1-deposit-calculator/task.md
@@ -17,5 +17,5 @@ The formula is:
17
// initial: the initial money sum
18
// interest: e.g. 0.05 means 5% per year
19
// years: how many years to wait
20
-let result = Math.round(initial * (1 + interest * years));
+let result = Math.round(initial * (1 + interest) ** years);
21
```
0 commit comments