Categories: Math
FLOOR
Returns the nearest equal or smaller value of the input expression. FLOAT and DOUBLE inputs keep their numeric type, while DECIMAL inputs return a DECIMAL with scale 0 and a precision that may increase when needed to represent the rounded whole-number result. Returns NULL if the input is NULL.
Syntax
FLOOR(numeric_expression NUMERIC) → NUMERIC
- numeric_expression: The number (DOUBLE, FLOAT, INTEGER, DECIMAL) for which you want to compute the floor.
Examples
FLOOR exampleSELECT FLOOR(0)
-- 0
SELECT FLOOR(45.76)
-- 45
SELECT FLOOR(-1.3)
-- -2
SELECT FLOOR(CAST(3.14 AS FLOAT))
-- 3.0