Parsing values out of strings using culture independend settings

When parsing a value out of a string the current separator is used. In English this is a dot. In other languages a comma is being used.
When parsing a string the current culture setting is being used!

To ensure the dot is being used as separator use the method below:

double value = Convert.ToDouble(text, CultureInfo.InvariantCulture);

Leave a Reply

Your email address will not be published. Required fields are marked *