SQLite FLOOR() Function
Definition and Usage
The FLOOR() function rounds a number down, to the largest integer that is less than or equal to the number.
Note: Some SQLite builds do not include the math functions, because they need the compile option SQLITE_ENABLE_MATH_FUNCTIONS. They work in our editor.
Tip: Also look at CEIL(), ROUND(), TRUNC().
Syntax
FLOOR(number)
Parameter Values
| Parameter | Description |
|---|---|
| number | Required. A number |
Technical Details
| Return type: | Integer or real |
|---|---|
| Works in: | SQLite 3.35.0 and later |
More Examples
Example
Round the prices down:
SELECT ProductName, Price, FLOOR(Price)
FROM Products;
Try it Yourself »