Last post May 02, 2008 07:50 AM by toinedeboer
May 01, 2008 02:05 PM|toinedeboer|LINK
Because i use the automatic POST input with the post method and action i have got a problem with doubles.
When i am working local my doubles work with a " , " and when i publish my project to the my hosting server
de doubles work with ' . " ???????????????
So when i use the Post method and my actions are expacting a double and they get a double whit an other
seperator then the server is using my action gets an error.
Is there a way to set the seperator for doubles when i am programming and testing ????
(because i dont think that my hosting will change there settings)
May 01, 2008 04:25 PM|TheDeathArt|LINK
This is a issue of internalization. Read up about the subject and you'll understand :)
May 01, 2008 06:20 PM|levib|LINK
This is an internationalization issue. One of the things we're working on is identifying where we're using culture-specific string conversion and replacing occurrences with culture-invariant conversion. This should cause the behavior to remain consistent
across servers with different cultures.
May 02, 2008 01:36 AM|tgmdbm|LINK
For now tho, in your global.asax, in the Application Begin Request event, you can say
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
That should mean all code, including MVC framework, and yours, should all run under the same culture.
Then if you want to be explicit you should use CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator to get the character that is the decimal separator, whether that be a dot or a comma or whatever.
Hope this helps
May 02, 2008 07:50 AM|toinedeboer|LINK
That was a great help, but the NumberDecimalSeparator was readonly :-)
So i used an other aproche with web.config!
<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8"
It works great, tnx for your help.