CEIL
Description
The CEIL function is used to return the result of rounding up the numeric parameter expr
to the nearest decimal place at the d
-th position after the decimal point. When d
is negative, it means rounding to the left of the decimal point.
Parameter Description
expr
: The numeric parameter that needs to be rounded up. It can be of type float, double, tinyint, smallint, int, or bigint. The current version does not support the decimal type.d
: Optional parameter that indicates the number of decimal places to retain. The default value is 0, which means no decimal places are retained.d
can be a positive or negative number.
Return Result
Returns a value of the same type as expr
.
Usage Example
Notes
- When
d
is a non-integer, it will automatically be rounded down to the nearest integer. - When
d
is 0, the CEIL function will return the integer part, and the decimal part will be discarded. - When
expr
is negative, the CEIL function will return a smaller negative result.