Click here to Skip to main content
15,947,389 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I've some trouble with converting a decimal to a string. When I do so, the decimal dot is replaced by a comma.

I know it has to do with the cultureinfo and can be solved by adding an extra argument in the toString() function but is there an easy way to do this throughout the whole project?

Otherwise I have to repeat this code a couple of hundred times, wich doesn't make sense.

ledtech3 10-Jun-12 12:04pm    
Try,in the solution explorer, my project,Application tab,assembly information button, netural language, then select 1 from the list,
as Far as I know that should set the application to that Language.
If you want more information on that setting just press F1 once you get there.

1 solution

The culture information is provided to the framework by Windows. So firstly you may find you have the regional settings for your operating incorrectly configured.

Secondly, you can set the current culture in .Net. The following is an MS how to for ASP.Net:[^]

In ASP.Net it's done via the web.config


In windows applications it's advised to set it against your current thread.

Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR")

This is the how to:[^]
Share this answer
VJ Reddy 10-Jun-12 11:52am    
Correct. 5!
Sergey Alexandrovich Kryukov 11-Jun-12 0:57am    
Yes, a 5.
Bernhard Hiller 11-Jun-12 3:23am    
And for every new thread!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900