I am using german UI Culture in my asp.net application. I am changing my application\'s UI culture based on the language selected in the dropdown, on dropdown selected inde
Thread.CurrentUICulture
is intended to be used for User Interface, it's the language used to display text, orientation and so on.
Thread.CurrentCulture
is intended to be used for parsing/formatting stuffs. Date and time, numbers and string comparison (for example).
If you want to change only UI language (and to keep everything else with the culture of your web server) you have to modify only Thread.CurrentUICulture
.
This behavior is correct for German. However, you might want to use . When serializing to XML, inserting to database, etc. for doing so you can format using invariant culture. You can learn more about Invariant Culture in the following link: What does CultureInfo.InvariantCulture mean
In german culture Decimal is denoated by ","
German culture uses "." as a group separator and "," as the decimal separator
Refer wiki link
you can change number format info as per below code
Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = ".";
try below code for parsing the decimal values as per culture.
string str = "50,3";
Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
double d = double.Parse(str, Thread.CurrentThread.CurrentCulture.NumberFormat);
it gives result d = 50.3