I use .NET4
I use en-US locale, and want my application to work that way only.
Some of my software clients, though, are from countries (Norway - for example) where the decimal point is represented by ','.
Therefore the next line throws exception for my Norwegian client:
double a = double.Parse("1.5");
I've read I can change the CurrentCulture as follows:
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
The problem is that I have to do this for each thread seperately. Moreover, I'm not totally sure where I will implicitly parse a double, so I will have to do it on each Thread creation...
I've read that there is a solution for .NET 4.5, by changing setting the DefaultThreadCurrentCulture
.
Does anyone think of a general solution for this without upgrading my .NET framework version?