MathRound Method (Double, MidpointRounding) |
Rounds a double-precision floating-point value to the nearest integer. A parameter specifies how to round the value if it is midway between two other numbers.
Namespace: SystemAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static double Round(
double value,
MidpointRounding mode
)
Parameters
- value
- Type: SystemDouble
A double-precision floating-point number to be rounded. - mode
- Type: SystemMidpointRounding
Specification for how to round value if it is midway between two other numbers.
Return Value
Type:
DoubleThe integer nearest
value. If
value is halfway between two integers, one of which is even and the other odd, then
mode determines which of the two is returned.
Exceptions See Also