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

◆ CreateTruncating< TOther >()

static decimal INumber< decimal >. System.Decimal.CreateTruncating< TOther > ( TOther value)
inlinestatic

Definition at line 3301 of file Decimal.cs.

3302 {
3303 if (typeof(TOther) == typeof(byte))
3304 {
3305 return (byte)(object)value;
3306 }
3307 if (typeof(TOther) == typeof(char))
3308 {
3309 return (char)(object)value;
3310 }
3311 if (typeof(TOther) == typeof(decimal))
3312 {
3313 return (decimal)(object)value;
3314 }
3315 if (typeof(TOther) == typeof(double))
3316 {
3317 return (decimal)(double)(object)value;
3318 }
3319 if (typeof(TOther) == typeof(short))
3320 {
3321 return (short)(object)value;
3322 }
3323 if (typeof(TOther) == typeof(int))
3324 {
3325 return (int)(object)value;
3326 }
3327 if (typeof(TOther) == typeof(long))
3328 {
3329 return (long)(object)value;
3330 }
3331 if (typeof(TOther) == typeof(IntPtr))
3332 {
3333 return (long)(IntPtr)(object)value;
3334 }
3335 if (typeof(TOther) == typeof(sbyte))
3336 {
3337 return (sbyte)(object)value;
3338 }
3339 if (typeof(TOther) == typeof(float))
3340 {
3341 return (decimal)(float)(object)value;
3342 }
3343 if (typeof(TOther) == typeof(ushort))
3344 {
3345 return (ushort)(object)value;
3346 }
3347 if (typeof(TOther) == typeof(uint))
3348 {
3349 return (uint)(object)value;
3350 }
3351 if (typeof(TOther) == typeof(ulong))
3352 {
3353 return (ulong)(object)value;
3354 }
3355 if (typeof(TOther) == typeof(UIntPtr))
3356 {
3357 return (ulong)(UIntPtr)(object)value;
3358 }
3359 ThrowHelper.ThrowNotSupportedException();
3360 return 0m;
3361 }

References System.Runtime.Serialization.Dictionary, System.ThrowHelper.ThrowNotSupportedException(), and System.value.