System.Math.Round Method

Rounds a decimal value to a specified number of fractional digits.

Syntax

public static decimal Round (decimal d, int decimals)

Parameters

d
A decimal number to be rounded.
decimals
The number of decimal places in the return value.

Returns

The number nearest to d that contains a number of fractional digits equal to decimals.

Remarks

Note:

For examples and comprehensive usage information about this and other overloads of the Round method, see the erload:System.Math.Round reference page.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0