Returns the specified value rounded to the specified precision.
Syntax
Copy Code
|
---|
double Round ( double value, int digits ) |
Parameters
- value
- A number to be rounded.
- digits
- The number of significant fractional digits (precision) in the return value.
Return Value
Returns the number nearest to
value with precision equal to
digits. If
value is halfway between two numbers, one of which is even and the other odd, then the even number is returned. If the precision of
value is less than
digits, then
value is returned unchanged.
Remarks
The digits parameter specifies the number of significant fractional digits in the return value and ranges from 0 to 28. If digits is zero, then a whole number is returned.
This kind of rounding is sometimes called rounding to nearest, or banker's rounding. If digits is zero, this kind of rounding is sometimes called rounding toward zero.
See Also
Math Functions
Left Function
RTrim Function