The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
Math.Round Method (Decimal, Int32)
.NET Framework (current version)
Rounds a decimal value to a specified number of fractional digits.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- d
-
Type:
System.Decimal
A decimal number to be rounded.
- decimals
-
Type:
System.Int32
The number of decimal places in the return value.
Return Value
Type: System.DecimalThe number nearest to d that contains a number of fractional digits equal to decimals.
| Exception | Condition |
|---|---|
| ArgumentOutOfRangeException | decimals is less than 0 or greater than 28. |
| OverflowException | The result is outside the range of a Decimal. |
Note |
|---|
For examples and comprehensive usage information about this and other overloads of the Round method, see the Round reference page. |
Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show:
