Rounds a number to a specified number of decimal places.
The number to round.
The number of decimal places to round to.
The rounded number.
roundTo(3.14159, 2); // returns 3.14roundTo(1.005, 2); // returns 1.01roundTo(123.456, 0); // returns 123 Copy
roundTo(3.14159, 2); // returns 3.14roundTo(1.005, 2); // returns 1.01roundTo(123.456, 0); // returns 123
Rounds a number to a specified number of decimal places.