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
Another way to do switch on generic is:
switch (typeof(T)) { case Type intType when intType == typeof(int): ... case Type decimalType when decimalType == typeof(decimal): ... default: ... }