FLOOR

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the nearest integer less than or equal to the argument.

Syntax 

1floor(<dp_or_numeric>)

Arguments 

Required 

  • <dp_or_numeric>: The double precision or numeric value to round down.

Returns 

Returns the rounded-down value by using the same data type as the input.

Considerations 

  • floor rounds toward negative infinity, so it differs from trunc for negative values. For example, floor(-1.5) returns -2, but trunc(-1.5) returns -1.

Examples 

Round Down 

Round a value down to the nearest integer.

1SELECT floor(42.1) AS result;
2SELECT floor(-42.8) AS result;

Returns 42.0 and -43.0.

Related Documentation