Flash Lite 2.x and 3.0 ActionScript Language Reference

floor (Math.floor method)

public static floor(x:Number) : Number

Returns the floor of the number or expression specified in the parameter x. The floor is the closest integer that is less than or equal to the specified number or expression.

Parameters

x:Number - A number or expression.

Returns

Number - The integer that is both closest to, and less than or equal to, parameter x.

Example

The following code returns a value of 12:

Math.floor(12.5);

The following code returns a value of -7:

Math.floor(-6.5);