IE showing "decimal" instead of "comma"
I am having an issue with a slider (implemented using Prototype) and IE7. Upon the slider value change I update a with the value such as "42开发者_JAVA百科0,000".
Now on all browsers other than IE7 this is display correctly. But on IE7 it is displayed as "420.000" ..
my question is how did the "," become "."
the page has UTF-8 meta tag.
Any help?
Are you testing IE7 on a different machine or a VM? (I'm assuming so since getting multiple versions of IE on the same machine is practically impossible). It's possible that machine is set to a different locale. It's common in some European countries (not sure which ones) to use "." as the thousands separator, and "," as the decimal.
If this is the case, consider this a good test of how your software might behave for European visitors to your site.
Use the toLocaleString()
method of Number
s instead of hard-coding a locale so the user's own locale is used.
精彩评论