Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 04b2035

Browse files
bgribaudorwestMSFT
authored andcommitted
Clarifying SQL's ROUND behavior
Update round-transact-sql.md Fixing date
1 parent c71d22e commit 04b2035

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

docs/t-sql/functions/round-transact-sql.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "ROUND (Transact-SQL)"
33
description: "ROUND (Transact-SQL)"
44
author: MikeRayMSFT
55
ms.author: mikeray
6-
ms.date: "12/14/2017"
6+
ms.date: "03/28/2025"
77
ms.service: sql
88
ms.subservice: t-sql
99
ms.topic: reference
@@ -20,7 +20,7 @@ monikerRange: ">= aps-pdw-2016 || = azuresqldb-current || = azure-sqldw-latest |
2020
# ROUND (Transact-SQL)
2121
[!INCLUDE [sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw](../../includes/applies-to-version/sql-asdb-asdbmi-asa-pdw-fabricse-fabricdw.md)]
2222

23-
Returns a numeric value, rounded to the specified length or precision.
23+
Returns a numeric value, rounded to the specified length or precision.
2424

2525
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: [Transact-SQL syntax conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md)
2626

@@ -68,6 +68,13 @@ ROUND ( numeric_expression , length [ ,function ] )
6868
|ROUND(748.58, -2)|700.00|
6969
|ROUND(748.58, -3)|Results in an arithmetic overflow, because 748.58 defaults to decimal(5,2), which cannot return 1000.00.|
7070
|To round up to 4 digits, change the data type of the input. For example:<br /><br /> `SELECT ROUND(CAST (748.58 AS decimal (6,2)),-3);`|1000.00|
71+
72+
ROUND breaks ties by rounding half away away from zero (also known as commercial rounding).
73+
74+
|Examples|Result|
75+
|--------------|------------|
76+
|ROUND(1.15, 1)|1.2|
77+
|ROUND(-1.15, 1)|-1.2|
7178

7279
## Examples
7380

0 commit comments

Comments
 (0)