In this post explains how to use the ROUND function in SQL Server (Transact-SQL) with syntax and examples.
In SQL Server (Transact-SQL), the ROUND function returns a number rounded to a certain number of decimal places.
The syntax for the ROUND function in SQL Server (Transact-SQL) is:
The number to round.
The number of decimal places rounded to. This value must be a positive or negative integer. If this parameter is omitted, the ROUND function will round the number to 0 decimal places.
Optional. The operation can be either 0 or any other numeric value. When it is 0 (or this parameter is omitted), the ROUND function will round the result to the number of decimal_places. If operation is any value other than 0, the ROUND function will truncate the result to the number of decimal_places.
The ROUND function can be used in the following versions of SQL Server (Transact-SQL):
Let's look at some SQL Server ROUND function examples and explore how to use the ROUND function in SQL Server (Transact-SQL).
For example: