Culture extrange behavior
-
Hello all. I have a extrange behavior in my computer. My regional configuration is Spanish ( Spain ) which means that the local decimal separator is ','. If I run this code the results are double d = 5.1; string s = d.ToString (); //s= "5.1" which is not the expected result ( it must be "5,1"). I have checked the value of System.Threading.Thread.CurrentThread.CurrentCulture and the culture is spanish-spain and the currency decimal separator is ','. But the most extrang thing is that I have gone to the control panel, I have changed the local configuration to Catalonian, then without close the dialog I have changed another time to Spanish-Spain and after that the previous code works and the double is translated to "5,1". Anyone have some similar problems ? Is this a bug of the framework. Can anyone help me ? :confused: Best regards Jose Vicente
-
Hello all. I have a extrange behavior in my computer. My regional configuration is Spanish ( Spain ) which means that the local decimal separator is ','. If I run this code the results are double d = 5.1; string s = d.ToString (); //s= "5.1" which is not the expected result ( it must be "5,1"). I have checked the value of System.Threading.Thread.CurrentThread.CurrentCulture and the culture is spanish-spain and the currency decimal separator is ','. But the most extrang thing is that I have gone to the control panel, I have changed the local configuration to Catalonian, then without close the dialog I have changed another time to Spanish-Spain and after that the previous code works and the double is translated to "5,1". Anyone have some similar problems ? Is this a bug of the framework. Can anyone help me ? :confused: Best regards Jose Vicente
I think that problem can be solved in Windows. There are possibilities to change culture-settings in "control panel" -> "regional settings" -> "numbers" (At least Win2000). There are many settings which you can change. Perhaps is Windows meaning that i Spain the standard seperator is '.'? Try this and hope that this works... If not, I´m sorry to reply this question, and forgot everything I wrote ;-) Ciao Norman-Timo
-
I think that problem can be solved in Windows. There are possibilities to change culture-settings in "control panel" -> "regional settings" -> "numbers" (At least Win2000). There are many settings which you can change. Perhaps is Windows meaning that i Spain the standard seperator is '.'? Try this and hope that this works... If not, I´m sorry to reply this question, and forgot everything I wrote ;-) Ciao Norman-Timo
Thanks.