Round the number to two decimal places.
SELECT ROUND(235.415, 2) AS RoundValue; |
The ROUND() function adjusts a number to a specified decimal precision.
Tip: Explore the FLOOR() and CEILING() functions for floor and ceiling rounding operations.
ROUND(number, decimals, operation) |
Parameter |
Description |
number |
Required: The numerical value that needs to be rounded. |
decimals |
Required: The number of decimal places to which the number should be rounded. |
operation |
Optional: If set to 0, the function rounds the result to the specified number of decimal places. If set to a non-zero value, it truncates the result to that number of decimal places. The default value is 0. |
Works in: |
SQL Server (beginning from 2008), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse |
Round the number to 2 decimal places, and optionally utilize the operation parameter.
SELECT ROUND(235.415, 2, 1) AS RoundValue; |
Round the number to the nearest whole number (integer).
SELECT ROUND(235.415, –1) AS RoundValue; |