Round Method
MSDN Home
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
.NET Framework Class Library
System Namespace
Math Class
Math Methods
Round Method
Round Method (Decimal)
Round Method (Double)
Round Method (Decimal, Int32)
Round Method (Decimal, Midpoin ...
Round Method (Double, Int32)
Round Method (Double, Midpoint ...
Round Method (Decimal, Int32, ...
Round Method (Double, Int32, M ...
Math Methods
Abs Method
Acos Method
Asin Method
Atan Method
Atan2 Method
BigMul Method
Ceiling Method
Cos Method
Cosh Method
DivRem Method
Exp Method
Floor Method
IEEERemainder Method
Log Method
Log10 Method
Max Method
Min Method
Pow Method
Round Method
Sign Method
Sin Method
Sinh Method
Sqrt Method
Tan Method
Tanh Method
Truncate Method
Switch View :
Classic
Lightweight Beta
ScriptFree
Feedback
.NET Framework Class Library
Math
.
.
::
.
Round Method
Rounds a value to the nearest integer or specified number of decimal places.
Overload List
Name
Description
Round(Decimal)
Rounds a decimal value to the nearest integral value.
Round(Double)
Rounds a double-precision floating-point value to the nearest integral value.
Round(Decimal, Int32)
Rounds a decimal value to a specified number of fractional digits.
Round(Decimal, MidpointRounding)
Rounds a decimal value to the nearest integer. A parameter specifies how to round the value if it is midway between two other numbers.
Round(Double, Int32)
Rounds a double-precision floating-point value to a specified number of fractional digits.
Round(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.
Round(Decimal, Int32, MidpointRounding)
Rounds a decimal value to a specified number of fractional digits. A parameter specifies how to round the value if it is midway between two other numbers.
Round(Double, Int32, MidpointRounding)
Rounds a double-precision floating-point value to the specified number of fractional digits. A parameter specifies how to round the value if it is midway between two other numbers.
Top
See Also
Reference
Math Class
Math Members
System Namespace
Tags :
Community Content
DoomGoober
Default Rounding Method
By default, Math.Round uses MidpointRounding.ToEven. Most people are not familiar with "rounding to even" as the alternative, "rounding away from zero" is more commonly taught in school. .NET defaults to "Rounding to even" as it is statistically superior because it doesn't share the tendency of "rounding away from zero" to round up slightly more often than it rounds down (assuming the numbers being rounded tend to be positive.)
Tags :
round
math.round
rounding