Is there a way to determine whether or not a given .Net Type is a number? For example: System.UInt32/UInt16/Double are all numbers. I want to avoid a long switc
System.UInt32/UInt16/Double
They are all value types (except for bool and maybe enum). So you could simply use:
bool IsNumberic(object o) { return (o is System.ValueType && !(o is System.Boolean) && !(o is System.Enum)) }