I'm developing an MVC3 application and I have the problem that many users according with their preferences prefer dot as decimal separator or comma (for example the download of Excel files using a csv file with changed extension required a specific format for avoiding user have to replace dot for comma and viceversa). My solution for now is a radiobutton and store everything as string and replace the default by the selected value (comma or dot) There is another solution which avoid the transformation of everything to string?
Asked
Active
Viewed 104 times
0
-
1http://www.hanselman.com/blog/GlobalizationInternationalizationAndLocalizationInASPNETMVC3JavaScriptAndJQueryPart1.aspx has a lot of info on this sort of thing. Also, you shouldn't store numerical values as strings (which are culture-dependent), but as numerical values, and then when you convert them to strings, use the correct culture – Tim S. Jan 21 '14 at 17:42
-
I was lerning about that but I have a great issue: http://stackoverflow.com/questions/21287691/mvc3-globalization-issue could you help me? – rlartiga Jan 27 '14 at 12:28
1 Answers
1
Yeah, CultureInfo. Store things internaly using a predefined CultureInfo (whatever is local to your region). Associate the radion button values to cultures that are using dot (english) or comma(french) and then serve the values using the chosen culture info.
The point is you keep the values internally using ONE format then use the desired culture info to display them.

MikeSW
- 16,140
- 3
- 39
- 53
-
I was lerning about that but I have a great issue: stackoverflow.com/questions/21287691/mvc3-globalization-issue could you help me? – rlartiga Jan 27 '14 at 16:31