System.Math.Math.RoundAwayFromZero C# (CSharp) Méthode

RoundAwayFromZero() static private méthode

static private RoundAwayFromZero ( decimal d ) : decimal
d decimal
Résultat decimal
		static decimal RoundAwayFromZero (decimal d)
		{
			decimal int_part = Decimal.Floor(d);
			decimal dec_part = d - int_part;
			if (int_part >= 0 && dec_part >= 0.5M)
				int_part++;
			else if (int_part < 0 && dec_part > 0.5M)
				int_part++;
			return int_part;
		}