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

◆ ToByte() [1/3]

static byte System.Decimal.ToByte ( decimal value)
inlinestatic

Definition at line 2624 of file Decimal.cs.

2625 {
2626 uint num;
2627 try
2628 {
2629 num = ToUInt32(value);
2630 }
2631 catch (OverflowException)
2632 {
2633 Number.ThrowOverflowException(TypeCode.Byte);
2634 throw;
2635 }
2636 if (num != (byte)num)
2637 {
2638 Number.ThrowOverflowException(TypeCode.Byte);
2639 }
2640 return (byte)num;
2641 }
static uint ToUInt32(decimal d)
Definition Decimal.cs:2758

References System.Number.ThrowOverflowException(), System.Decimal.ToUInt32(), and System.value.

Referenced by System.Decimal.operator byte().