Rounds a number to a given decimal place.
This function rounds a number to the specified number of decimal places. If the decimal parameter is not provided, it defaults to 2.
The number to round.
Optional
The number of decimal places to round to. Defaults to 2.
round(3.14159); // 3.14round(3.14159, 3); // 3.142round(3.14159, 0); // 3 Copy
round(3.14159); // 3.14round(3.14159, 3); // 3.142round(3.14159, 0); // 3
Rounds a number to a given decimal place.
This function rounds a number to the specified number of decimal places. If the decimal parameter is not provided, it defaults to 2.