Click or drag to resize
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: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
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: Double
The 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
ExceptionCondition
ArgumentExceptionmode is not a valid value of MidpointRounding.
See Also