SQLite TRUNC() Function
Definition and Usage
The TRUNC() function removes the decimals of a number, and returns the integer part. It rounds toward zero, so -25.75 becomes -25.
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 ROUND(), FLOOR(), CEIL().
Syntax
TRUNC(number)
Parameter Values
| Parameter | Description |
|---|---|
| number | Required. A number |
Technical Details
| Return type: | Real |
|---|---|
| Works in: | SQLite 3.35.0 and later |