Tabular IQ
Back to Function Index

CEILING()

Overview

CEILING() returns the smallest number, to the specified precision, that is greater than or equal to the input number. If no precision is specified, CEILING() returns the smallest integer greater than or equal to the input number. This function is useful for rounding up numbers to a specific decimal place or to the nearest whole number.

Function Format

CEILING(number [, precision])

Return Value

CEILING() returns a numeric value rounded up to the specified precision

Examples


CEILING(10.333)      = 11      (rounds up to nearest integer)
CEILING(-10.333)     = -10     (rounds up to nearest integer)
CEILING(10.333, 2)   = 10.34   (rounds up to 2 decimal places)
CEILING(-10.333, 2)  = -10.33  (rounds up to 2 decimal places)
CEILING(1024, -2)    = 1100    (rounds up to nearest hundred)
CEILING(3.14159, 3)  = 3.142   (rounds up to 3 decimal places)
CEILING(1000, -3)    = 1000    (rounds up to nearest thousand)

Notes

  • The precision parameter is optional. If omitted, the function rounds up to the nearest integer.
  • A positive precision rounds to that many decimal places.
  • A negative precision rounds to the left of the decimal point (e.g., -2 rounds to hundreds).
  • For negative numbers, "rounding up" means moving towards zero.
  • The function can handle both positive and negative numbers.
  • This function is commonly used in financial calculations and when precise rounding is required.
  • CEILING() is equivalent to CEIL() in some database systems.

See Also