Click or drag to resize
MathRound Method (Double, Int32)
Rounds a double-precision floating-point value to a specified number of fractional digits.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static double Round(
	double value,
	int digits
)

Parameters

value
Type: SystemDouble
A double-precision floating-point number to be rounded.
digits
Type: SystemInt32
The number of fractional digits in the return value.

Return Value

Type: Double
The number nearest to value that contains a number of fractional digits equal to digits.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptiondigits is less than 0 or greater than 15.
See Also