首页 > 代码库 > [csharp] bool IsNumeric(Type type)

[csharp] bool IsNumeric(Type type)

static bool IsNumeric(Type type){    switch (Type.GetTypeCode(type))    {        case TypeCode.Byte:        case TypeCode.SByte:        case TypeCode.UInt16:        case TypeCode.UInt32:        case TypeCode.UInt64:        case TypeCode.Int16:        case TypeCode.Int32:        case TypeCode.Int64:        case TypeCode.Decimal:        case TypeCode.Double:        case TypeCode.Single:            return true;        default:            return false;    }}

 

[csharp] bool IsNumeric(Type type)