round

.round()

Returns this number, rounded to the nearest whole number.

Rounding uses 'half up', which means that fractions of 0.5 are always rounded up. For example, 0.5, 1.5, 2.5 and 3.5 would all be rounded up to their nearest whole number. All fractions less then 0.5, are rounded down.

n =   5.ceil() // set to 5
n = 5.1.ceil() // set to 5

n = 5.5.ceil() // set to 6
n = 5.9.ceil() // set to 6
n =   6.ceil() // set to 6

See also

ceil - floor