Math.round(number)
Top  Previous  Next


SWiSH Player Support
SWF4 or later - Supported Internally

Syntax
Math.round(x)

Arguments
x: A number or expression.

Returns
An integer.

Description
Rounds the value of the parameter x up or down to the nearest integer and returns the value.

Sample
Math.round(4
.8);      // returns the value 5
Math.round(4
.2);      // returns the value 4
Math.round(-4
.8);   // returns the value -5

See Also
Math.ceil(), Math.floor() and Math.round()
.