Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
System Namespace
Math Class
Math Methods
Round Method
Members FilterMembers Filter
Frameworks FilterFrameworks Filter
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
Math..::.Round Method

Updated: November 2007

Rounds a value to the nearest integer or specified number of decimal places.

  NameDescription
Round(Decimal) Rounds a decimal value to the nearest integer.
Round(Double) Rounds a double-precision floating-point value to the nearest integer.
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
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Default Rounding Method      Jackerran   |   Edit   |  
Math.Round automatically rounds to the nearest even number by default, to get true midpoint rounding you must specify MidpointRounding.AwayFromZero in the MidpointRounding parameter
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker