System.Math.Math.Round C# (CSharp) Method

Round() public static method

public static Round ( decimal d, MidpointRounding mode ) : decimal
d decimal
mode MidpointRounding
return decimal
		public static decimal Round (decimal d, MidpointRounding mode)
		{
			if ((mode != MidpointRounding.ToEven) && (mode != MidpointRounding.AwayFromZero))
				throw new ArgumentException ("The value '" + mode + "' is not valid for this usage of the type MidpointRounding.", "mode");

			if (mode == MidpointRounding.ToEven)
				return Round (d);
			else
				return RoundAwayFromZero (d);
		}

Same methods

Math.Math::Round ( decimal d ) : decimal
Math.Math::Round ( decimal d, int decimals ) : decimal
Math.Math::Round ( decimal d, int decimals, MidpointRounding mode ) : decimal
Math.Math::Round ( double a ) : double
Math.Math::Round ( double value, MidpointRounding mode ) : double
Math.Math::Round ( double value, int digits ) : double
Math.Math::Round ( double value, int digits, MidpointRounding mode ) : double