SQLite floor() Function

The SQLite floor() function returns the largest integer value less than or equal to the number specified by the parameter.

Syntax

Here is the syntax of the SQLite floor() function:

floor(numeric_value)

Parameters

numeric_value

Required. A number, it can be positive, negative, or zero, it can be an integer or a decimal.

Return value

The SQLite floor() function returns the largest integer value less than or equal to the number specified by the parameter. floor() function

The SQLite floor() function will return NULL if the parameter is NULL.

The SQLite floor() function will return NULL if you provide a parameter that is not a numeric value.

Examples

This example shows the basic usage of the SQLite floor() function:

SELECT
    floor(0),
    floor(10),
    floor(10.11),
    floor(-10.11);
     floor(0) = 0
    floor(10) = 10
 floor(10.11) = 10.0
floor(-10.11) = -11.0