CEILING (CEIL)

Rounds the returned value up to the next whole number. Any expression that contains even a slight decimal is rounded up.

Behavior Type

Immutable

Syntax

CEILING ( expression )CEIL ( expression )

Parameters

expression 

Is a value of type INTEGER or DOUBLE PRECISION

Notes

CEILING is the opposite of FLOOR, which rounds the returned value down:

=> SELECT CEIL(48.01) AS ceiling, FLOOR(48.01) AS floor;
 ceiling | floor
---------+-------
      49 |    48
(1 row)

Examples

=> SELECT CEIL(-42.8);
 CEIL
------
  -42
(1 row)
SELECT CEIL(48.01);
 CEIL
------
   49
(1 row)