Value
|
Description
|
---|---|
1
|
Round Val to a number of significant digits rather than to a number of decimal places.
|
2
|
If Val is exactly halfway between the two nearest values of the required precision, round to the higher value rather than rounding to even. However, if value 4 below is also set, round to the lower value of the two nearest values.
|
4
|
If Val is exactly halfway between the two nearest values of the required precision, round to odd rather than rounding to even. However, if value 2 above is also set, round to the lower of the two nearest values.
|
8
|
If Val is negative and exactly halfway between the two nearest values of the required precision, round the absolute value and make its sign negative. If this value is set, "higher" and "lower" in values 2 and 4 above means "having a larger absolute value" and "having a smaller absolute value" respectively. This value has no effect if value 2 is not set.
|
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
|