Link Search Menu Expand Document

CEIL

Synonym: CEILING

Returns the smallest value that is greater than or equal to <value>.

Syntax

CEIL(<value>); 

OR

CEILING(<value>);

Parameters

Parameter Description Supported input types
<value> The value that will determine the returned value DOUBLE PRECISION

Return Type

DOUBLE PRECISION

Remarks

When the input is of type NUMERIC, this function throws an overflow error if the result does not fit into the return type.

For example:

SELECT
    CEIL('99.99'::NUMERIC(4,2));

Returns: OVERFLOW ERROR, because CEIL will produce the value 100, but it can not fit into the NUMERIC type with only 2 whole digits.

Examples

SELECT
    CEIL(2.5549900);

Returns: 3

SELECT
    CEIL('213.1549'::NUMERIC(20,4));

Returns: 214.0000