My web application deals with strings that need to be converted to numbers a lot - users often put commas, units (like cm, m, g, kg) and currency symbols in these fields so
The biggest problem is that you must know the Culture in which the user enters the number. Otherwise you will run into big problems.
A little example is the to read your number as english or german one.
In english the NumberFormatInfo.CurrencyDecimalSeparator is a dot (.) and the NumberFormatInfo.CurrencyGroupSeparator is a comma (,). In german it is exactly the other way around. So you can start wild guessing if the user means one thousand two hundred fifty or one and a fourth dollar.
Maybe you can run over all available Cultures and check if your user input contains a NumberFormatInfo.CurrencySymbol and then try the given culture. But maybe there are cultures which use the same Symbol but different Separators.
So to get this really to work you have just two really choices: * Tell your users in which culture format they have to enter their values. * Give the user the possibility to tell you which culture they decided to do.
A list of all available cultures can be get by CultureInfo.GetCultures()