Ceiling

Description

Retrieves the smallest whole number that is greater than or equal to a specified limit.

Syntax

Ceiling ( n )

Argument

Description

n

The number for which you want the smallest whole number that is greater than or equal to it


Return value

The datatype of n. Returns the smallest whole number that is greater than or equal to n.

Examples

These expressions both return -4:

Ceiling(-4.2)

Ceiling(-4.8)

This expression for a computed field returns ERROR if the value in discount_amt is greater than the smallest whole number that is greater than or equal to discount_factor times price. Otherwise, it returns discount_amt:

If(discount_amt <= Ceiling(discount_factor * price),
String(discount_amt), "ERROR")

To pass this validation rule, the value in discount_amt must be less than or equal to the smallest whole number that is greater than or equal to discount_factor times price:

discount_amt <= Ceiling(discount_factor * price)

See also

Int

Round

Truncate

Ceiling in the section called “Ceiling” in PowerScript Reference