Course · Section 12: Numbers, Dates, Intl and Timers · Lecture 182: Math and Rounding
Implement `roundTo(n, decimals)` rounding `n` to the given number of decimal places.
+ 1 hidden test run on Submit.
Multiplying by a power of ten, rounding, then dividing back rounds to the chosen precision.
Run your code to see results.