round(x): Returns x rounded to the nearest whole integer : round « Math Functions « PostgreSQL






round(x): Returns x rounded to the nearest whole integer


postgres=#
postgres=# -- round(x): Returns x rounded to the nearest whole integer
postgres=#
postgres=# SELECT round(1.0) AS one,
postgres-#        round(1.1) AS "one point one",
postgres-#        round(1.5) AS "one point five",
postgres-#        round(1.8) AS "one point eight";
 one | one point one | one point five | one point eight
-----+---------------+----------------+-----------------
   1 |             1 |              2 |               2
(1 row)

postgres=#
           
       








Related examples in the same category

1.round(x, s): Returns the value of x, optionally rounded to s decimal places
2.SELECT round(4, 4)