PostgreSQL/Math Functions/floor — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Версия 13:45, 26 мая 2010
floor(dp or numeric) largest integer not greater than argument
postgres=# -- floor(dp or numeric) largest integer not greater than argument
postgres=#
postgres=# select floor(-42.8);
floor
-------
-43
(1 row)
postgres=#
postgres=#
floor(x): Returns the largest whole integer not greater than x (rounds down)
postgres=#
postgres=#
postgres=# -- floor(x): Returns the largest whole integer not greater than x (rounds down)
postgres=# SELECT floor(1.0) AS one,
postgres-# floor(1.1) AS "one point one",
postgres-# floor(1.8) AS "one point eight";
one | one point one | one point eight
-----+---------------+-----------------
1 | 1 | 1
(1 row)
postgres=#