Ceiling
DataWindow expression function
Description
Retrieves the smallest whole number that is greater than or equal to
a specified limit.
Syntax
1 |
Ceiling ( n ) |
Argument |
Description |
---|---|
n |
The number for which you want the smallest whole |
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:
1 2 3 |
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:
1 2 |
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:
1 |
discount_amt <= Ceiling(discount_factor * price) |
See also
Ceiling in the section called “Ceiling” in PowerScript Reference