In my convert method i get the wrong number separators when i use TypeConverter.ConvertToString(Object)
because my system is in german. There is another overload for this method which looks like this: TypeConverter.ConvertToString(ITypeDescriptorContext, CultureInfo, Object)
.
Is there a smart way to obtain the ITypeDescriptorContext
or another option to call this method with InvariantCulture
besides switching the culture before and after?
You can pass null
as a parameter
TypeConverter.ConvertToString(null,
CultureInfo.InvariantCulture, Object);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With