File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
2-ui/4-forms-controls/3-events-change-input/1-deposit-calculator Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change 9696 let years = form . months . value / 12 ;
9797 if ( ! years ) return ;
9898
99- let result = Math . round ( initial * ( 1 + interest * years ) ) ;
99+ let result = Math . round ( initial * ( 1 + interest ) ** years ) ;
100100
101101 let height = result / form . money . value * 100 + 'px' ;
102102 document . getElementById ( 'height-after' ) . style . height = height ;
Original file line number Diff line number Diff line change @@ -17,5 +17,5 @@ The formula is:
1717// initial: the initial money sum
1818// interest: e.g. 0.05 means 5% per year
1919// years: how many years to wait
20- let result = Math .round (initial * (1 + interest * years) );
20+ let result = Math .round (initial * (1 + interest) ** years);
2121```
You can’t perform that action at this time.
0 commit comments