Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Variables
  6. Dates
  7. Functions
  8. Creating Custom Functions
  9. Custom Function API Reference

Transformation Language Reference

Transformation Language Reference

FLOOR

FLOOR

Returns the largest integer less than or equal to the numeric value you pass to this function. For example, if you pass 3.14 to FLOOR, the function returns 3. If you pass 3.98 to FLOOR, the function returns 3. Likewise, if you pass -3.17 to FLOOR, the function returns -4.

Syntax

FLOOR(
numeric_value
)
The following table describes the argument for this command:
Argument
Required/
Optional
Description
numeric_value
Required
Numeric datatype. You can enter any valid transformation expression as long as it evaluates to numeric data.

Return Value

Integer if you pass a numeric value with declared precision between 0 and 28.
Double 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 largest integer less than or equal to the values in the PRICE port:
FLOOR( PRICE )
PRICE
RETURN VALUE
39.79
39
125.12
125
74.24
74
NULL
NULL
-100.99
-101
You can perform arithmetic on the values you pass to FLOOR. For example, to multiply a numeric value by 10 and then calculate the largest integer that is less than the product, you might write the function as follows:
FLOOR( UNIT_PRICE * 10 )

0 COMMENTS

We’d like to hear from you!