Math.ceil( ) Method | Flash 5; can be used when exporting Flash 4 movies |
round a number up to the next integer |
A number.
The next integer greater than or equal to x.
The ceil( ) (i.e., ceiling) method converts a floating-point number to the first integer greater than or equal to x. It leaves integers unchanged.
Math.ceil(1.00001); // Returns 2 Math.ceil(5.5); // Returns 6 Math.ceil(-5.5); // Returns -5 Math.ceil(3); // Returns 3