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

◆ ToInt32() [1/3]

static int System.Decimal.ToInt32 ( decimal d)
inlinestatic

Definition at line 2687 of file Decimal.cs.

2688 {
2689 Truncate(ref d);
2690 if ((d.High | d.Mid) == 0)
2691 {
2692 int low = (int)d.Low;
2693 if (!d.IsNegative)
2694 {
2695 if (low >= 0)
2696 {
2697 return low;
2698 }
2699 }
2700 else
2701 {
2702 low = -low;
2703 if (low <= 0)
2704 {
2705 return low;
2706 }
2707 }
2708 }
2709 throw new OverflowException(SR.Overflow_Int32);
2710 }
static decimal Truncate(decimal d)
Definition Decimal.cs:2792

References System.Runtime.Serialization.Dictionary, System.SR.Overflow_Int32, and System.Decimal.Truncate().

Referenced by System.Decimal.operator int(), System.Decimal.ToInt16(), and System.Decimal.ToSByte().