Math.ceil( ) function

The Math.ceil() function in JavaScript is used to round the number passed as a parameter to its nearest integer in Upward direction of rounding i.e towards the greater value.

Parameters: This functions accepts a single parameter is the number to be rounded to its nearest integer in upward rounding method. Returns: Result after rounding the number passed as parameter to the function.

Examples:

Input  : Math.ceil(4.23)
Output : 5

Input  : Math.ceil(0.8)
Output : 1

Last updated