FLOOR()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Xpand
Topics on this page:
Overview
Returns the nearest integer value, rounding downwards.
USAGE
FLOOR(number)
Argument Name | Description |
---|---|
| The number to round |
DETAILS
FLOOR()
is a mathematical function that returns the nearest integer that is either equal to or lower than the input value. For positive numbers, this can be visualized as removing the fractional portion of a number.
A NULL
is returned if the argument is NULL
.
EXAMPLES
SELECT FLOOR(1.8) AS a,
FLOOR(-1.1) AS b,
FLOOR(-0.0) AS c;
+------+------+------+
| a | b | c |
+------+------+------+
| 1 | -2 | 0 |
+------+------+------+