I want to write a function that format int and decimal differently into string
int
decimal
I have this code:
and I want to rewrite it to generi
You might use TypeCode for switch:
switch (Type.GetTypeCode(typeof(T))) { case TypeCode.Int32: break; case TypeCode.Decimal: break; }