Skip to content

ceil ​

The ceil() method rounds a number up to the next integer greater than or equal to it. This function is useful to ensure you always have enough resources (boxes, pages, etc.).

Interactive example ​

Syntax ​

typescript
function ceil<
	GenericInput extends number,
>(input: GenericInput): number

Parameters ​

  • input: The number to round up.

Return value ​

The smallest integer greater than or equal to the given number.

See also ​

  • round - Rounds to the nearest integer
  • floor - Rounds down
  • trunc - Truncates the decimal part

Sources ​

Released under the MIT license.