floor(X)

Returns the largest integer less than or equal to the given value. The result is a decimal data type.

Syntax

floor(X)

Input

Argument Type Description
X any numeric type A numeric value

Return Value

Returns a decimal value corresponding to the largest integer less than or equal to X.

If X is N/A, the result is N/A.

Sample Usage

X floor(X)
-5.25 -6
-5.0 -5
13 13
4.5 4
5.0 5
NA NA

Example

In this example, the floor(X) function returns the largest integer less than or equal to the value of sales on the pub.demo.retail.item table. The new column contains decimal data type values.

<base table="pub.demo.retail.item"/>
<colord cols="transid, account, store, date, sku, sales"/>
<willbe name="floorsales" value="floor(sales)"/>