jpierson / to-markdown-table

Extension method for generating text output in Markdown table format.
MIT License
19 stars 2 forks source link

Treat nullable numeric value types as numbers with respect to alignment #4

Open jpierson opened 7 years ago

jpierson commented 7 years ago

Currently the check for numeric types isn't taking into account cases like Nullable<int> / int?. Playing around a little bit in Linqpad it looks like we should be able to do the following. I'm unsure if this would be compatible with .NET Standard 1.2 though given the differences in Reflection APIs.

typeof(Nullable<int>).IsGenericType &&
typeof(Nullable<int>).GetGenericTypeDefinition() == typeof(Nullable<>)