Function call
|
Val
|
Digits
|
Result
|
Notes
|
---|---|---|---|---|
Round(Val, Digits)
|
1234.5678
|
2
|
1234.57
|
Rounded to 2 decimal places
|
Round(Val, Digits)
|
28.613
|
1
|
28.6
|
Rounded to 1 decimal place
|
Round(Val, Digits)
|
62.75
|
1
|
62.8
|
Borderline case, rounded to even
|
Round(Val, Digits)
|
62.85
|
1
|
62.8
|
Borderline case, rounded to even
|
Round(Val, Digits)
|
1234.5678
|
NULL
|
1235
|
Rounded to an integer
|
Function call
|
Val
|
Digits
|
Policy
|
Result
|
Notes
|
---|---|---|---|---|---|
Round(Val, Digits, Policy)
|
1234.5678
|
3
|
0
|
1234.568
|
Rounded to 3 decimal places
|
Round(Val, Digits, Policy)
|
1234.5678
|
3
|
1
|
1230
|
Rounded to 3 significant digits
|
Round(Val, Digits, Policy)
|
1234.5678
|
6
|
1
|
1234.57
|
Rounded to 6 significant digits
|
Round(Val, Digits, Policy)
|
1234.5678
|
0
|
1
|
1000
|
Rounded to 1 significant digit
|
Round(Val, Digits, Policy)
|
62.85
|
1
|
0
|
62.8
|
Borderline case, rounded to even
|
Round(Val, Digits, Policy)
|
62.85
|
1
|
2
|
62.9
|
Borderline case, rounded to higher value
|
Round(Val, Digits, Policy)
|
-62.85
|
1
|
2
|
-62.8
|
Borderline case, rounded to higher value
|
Round(Val, Digits, Policy)
|
-62.85
|
1
|
6
|
-62.9
|
Borderline case, rounded to lower value
|
Round(Val, Digits, Policy)
|
135
|
2
|
1
|
140
|
Borderline case, rounded to even
|
Round(Val, Digits, Policy)
|
135
|
2
|
5
|
130
|
Borderline case, rounded to odd
|
Round(Val, Digits, Policy)
|
-107.135
|
2
|
2
|
-107.13
|
Borderline case, rounded to higher value
|
Round(Val, Digits, Policy)
|
-107.135
|
2
|
10
|
-107.14
|
Borderline case, rounded to absolute higher value and made negative
|