November 2001
Intermediate to advanced
936 pages
68h 43m
English
Math.round( ) — round to the nearest integer
JavaScript 1.0; JScript 1.0; ECMAScript v1
Math.round(x)x
Any number.
The integer closest to x.
Math.round( ) rounds its argument up or down to
the nearest integer. It rounds .5 up. For example, it rounds 2.5 to 3
and rounds -2.5 to -2.