1

In my app I'm offering a text field to enter a number. Depending on the country in which this app is used, a user may enter different decimal separator i.e. "." (point) or "," (komma).

Using the line of code...

float.Parse(any_string)

... works using "." (point) and fails using "," (comma).

Does ".Parse" consider any windows country settings or does it only work with "." independent of any windows settings? Both would be acceptable. I simply need to know if I have to handle this, e.g. like this...

any_string.Replace(',','.')

... or if I can let it be, handled by some background intelligence of C#?

Thanks for your input. Cheers

RadioMan85
  • 337
  • 1
  • 11

0 Answers0