A double number to be rounded.
The number of significant fractional digits (precision) in the return value.
The midpoint rounding mode
RoundOff(Double,Int32,MidpointRounding) Method
Rounds using arithmetic (5 rounds up) symmetrical (up is away from zero) rounding
Syntax
[Extension()]
public static double RoundOff( 
   double d,
   int decimals,
   MidpointRounding mode
)

Parameters

d
A double number to be rounded.
decimals
The number of significant fractional digits (precision) in the return value.
mode
The midpoint rounding mode

Return Value

The number nearest d with precision equal to decimals. If d is halfway between two numbers, then the nearest whole number away from zero is returned.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also