Learn JavaScript
Math Object
18.7
Lesson

Rounding a Number

The Math.round() method rounds a number to its nearest integer.

2.4 is rounded to 2:

2.6 is rounded to 3: