I have a string read from a textbox. It contains a comma for decimal separation.
I have NumberFormatInfo.CurrencyDecimalSeparator set to ,
I had faced the similar issue while using Convert.ToSingle(my_value) If the OS language settings is English 2.5 (example) will be taken as 2.5 If the OS language is German, 2.5 will be treated as 2,5 which is 25 I used the invariantculture IFormat provided and it works. It always treats '.' as '.' instead of ',' irrespective of the system language.
float var = Convert.ToSingle(my_value, System.Globalization.CultureInfo.InvariantCulture);