Round the number to two decimal places.
| SELECT ROUND(135.375, 2); |
The ROUND() function adjusts a number to a specific number of decimal places.
Note: Also consider the functionalities of FLOOR(), CEIL(), CEILING(), and TRUNCATE() functions.
| ROUND(number, decimals) |
|
Parameter |
Description |
|
number |
Necessary: The numerical value to be rounded |
|
decimals |
If included, it specifies the number of decimal places to which the number should be rounded; if excluded, it returns the integer value (no decimal places). |
|
Works in: |
From MySQL version 4.0 |
Round the number to the nearest integer.
| SELECT ROUND(345.156, 0); |
Round the values in the “Price” column (to one decimal place) within the “Products” table.
| SELECT ProductName, Price, ROUND(Price, 1) AS RoundedPrice FROM Products; |