SQL ROUND Function - SQL Server Round() Function
The SQL ROUND() Function
- ROUND() rounds numbers to a specified decimal place. It takes two arguments: the number to round and the decimal places.
Parameter Values
- number: The number to be rounded.
- decimals: The number of decimal places to round the number to.
- operation: Optional. If set to 0, it rounds the result to the specified number of decimal places. If set to a value other than 0, it truncates the result to the specified number of decimal places. Default value is 0.
Syntax
SELECT ROUND(number, decimals, operation)
- Round the number to two decimal places.
Example
SELECT ROUND(number, decimals, operation)