A
Anders Eriksson
Hello,
I'm reading a text file that has some numbers in it (both integer and
double). I then want to convert the string number into an integer or double.
Since I'm in Sweden, .NET assumes that I want to use Swedish numbers.
But I don't! The file is from US so it contains decimal point instead of
decimal comma.
So I do this
double x = Convert.ToDouble(sX,
System.Globalization.NumberFormatInfo.InvariantInfo);
Which works, but ...
Isn't there someway of telling .NET that I always want to use this
NumberFormatInfo when dealing with numbers?
// Anders
I'm reading a text file that has some numbers in it (both integer and
double). I then want to convert the string number into an integer or double.
Since I'm in Sweden, .NET assumes that I want to use Swedish numbers.
But I don't! The file is from US so it contains decimal point instead of
decimal comma.
So I do this
double x = Convert.ToDouble(sX,
System.Globalization.NumberFormatInfo.InvariantInfo);
Which works, but ...
Isn't there someway of telling .NET that I always want to use this
NumberFormatInfo when dealing with numbers?
// Anders