Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Round() [5/5]

static decimal System.Decimal.Round ( ref decimal d,
int decimals,
MidpointRounding mode )
inlinestaticprivate

Definition at line 2591 of file Decimal.cs.

2592 {
2593 if ((uint)decimals > 28u)
2594 {
2595 throw new ArgumentOutOfRangeException("decimals", SR.ArgumentOutOfRange_DecimalRound);
2596 }
2597 if ((uint)mode > 4u)
2598 {
2599 throw new ArgumentException(SR.Format(SR.Argument_InvalidEnumValue, mode, "MidpointRounding"), "mode");
2600 }
2601 int num = d.Scale - decimals;
2602 if (num > 0)
2603 {
2604 DecCalc.InternalRound(ref AsMutable(ref d), (uint)num, mode);
2605 }
2606 return d;
2607 }
static ref DecCalc AsMutable(ref decimal d)
Definition Decimal.cs:3538

References System.SR.Argument_InvalidEnumValue, System.SR.ArgumentOutOfRange_DecimalRound, System.Decimal.AsMutable(), System.Runtime.Serialization.Dictionary, System.SR.Format(), and System.Decimal.DecCalc.InternalRound().