ROUND(X), ROUND(X,D) rounds the argument X to D decimal places. : ROUND « Math Numeric Functions « MySQL Tutorial






  1. D defaults to 0 if not specified.
  2. D can be negative to cause D digits left of the decimal point of the value X to become zero.
mysql>
mysql> SELECT ROUND(-1.23);
+--------------+
| ROUND(-1.23) |
+--------------+
|           -1 |
+--------------+
1 row in set (0.00 sec)

mysql> SELECT ROUND(-1.58);
+--------------+
| ROUND(-1.58) |
+--------------+
|           -2 |
+--------------+
1 row in set (0.00 sec)

mysql> SELECT ROUND(1.58);
+-------------+
| ROUND(1.58) |
+-------------+
|           2 |
+-------------+
1 row in set (0.00 sec)








21.31.ROUND
21.31.1.ROUND(X), ROUND(X,D) rounds the argument X to D decimal places.
21.31.2.ROUND(1.298, 1)
21.31.3.ROUND(1.298, 0)
21.31.4.ROUND(23.298, -1)
21.31.5.ROUND(150.000,2)/ROUND(150,2)
21.31.6.Rounding value in a column
21.31.7.How rounding differs for exact and approximate values: