Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

CEIL

CEIL

Returns the smallest integer greater than or equal to the numeric value passed to this function. For example, if you pass 3.14 to CEIL, the function returns 4. If you pass 3.98 to CEIL, the function returns 4. Likewise, if you pass -3.17 to CEIL, the function returns -3.

Syntax

CEIL(
numeric_value
)
Argument
Required/
Optional
Description
numeric_value
Required
Numeric datatype. You can enter any valid expression.

Return Value

Integer if you pass a numeric value with declared precision between 0 and 28.
Double value if you pass a numeric value with declared precision greater than 28.
NULL if a value passed to the function is NULL.

Example

The following expression returns the price rounded to the next integer:
CEIL( PRICE )
PRICE
RETURN VALUE
39.79
40
125.12
126
74.24
75
NULL
NULL
-100.99
-100

Tip

You can perform arithmetic on the values passed to CEIL before CEIL returns the next integer value. For example, if you wanted to multiply a numeric value by 10 before you calculated the smallest integer less than the modified value, you might write the function as follows:
CEIL( PRICE * 10 )

0 COMMENTS

We’d like to hear from you!