ceil()

The ceil() method is used to return the smallest integer that is greater than or equal to the number (see syntax) passed as the parameter. Basically, the ceil() method rounds the number to the nearest whole number (an integer).

syntax:

Math.ceil(number)

mathName.ceil(number)

EXAMPLE

newNumber = 455 * 12.5;

document.write("Utilizing the ceil() method, the newNumber is : " + Math.ceil(newNumber) )

The example shows the creation of a new number, the value for which is the product of the multiplication of 455 and 12.5. The documnet.write statement writes some descriptive text to the screen along with the value of newNumber with the ceil() method acted upon it. The answer to the multiplication of 455 and 12.5 is 5687.5. The results should look like the following:



Utilizing the ceil() method, the newNumber is : 5688