Math.round()
Rounds to the nearest integer.
Syntax
Math.round(number)
Description
0.5 and above rounds up, below rounds down.
Returns
Rounded integer.
Example
Loading editor…
Expected output
5 4
When to use?
Simplifying scores, averages, price displays.