I’m reading numbers from XML files. Other numbers are with a comma separator (0,1111) and others with dot (0.1111). How do I parse these numbers so I get the desired result in the end? I tried using float.Parse(reader.Value, System.Globalization.CultureInfo.InvariantCulture); but it doesn’t work. For example I have reader.Value = “0,01119703” and is parsed as 1119703.0.
I’m reading numbers from XML files. Other numbers are with a comma separator (0,1111)
Share
I don’t believe that it is possible to work with two different decimal separators at the same time. I think I would just use Replace() to change any commas into dots.