I had the same problem because I'm Italian and here decimal numbers are formatted with comma instead of dot. So, what in the US is 1,000.12 here is written 1.000,12.
That's how I solved, after some searching:
MVC3 already includes the script jquery.validate.js/jquery.validate.min.js
and that's amazing.
Then I added another script -- methods-it.js -- taken from jquery validate plugin localization folder and changed a little.
jQuery.extend(jQuery.validator.methods, {
date: function (value, element) {
return this.optional(element) || /^\d\d?\.\d\d?\.\d\d\d?\d?$/.test(value);
},
number: function (value, element) {
return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:\.\d{3})+)(?:,\d+)?$/.test(value);
},
range: function (value, element, param) {
var val = value.replace(",", "#").replace(".", ",").replace("#", ".");
return this.optional(element) || (val >= param[0] && val <= param[1]);
}
});
This small code deals with dates (Italian formatting), floating numbers and range of values.
It works great, now!
Unfortunately this is just a direction and not THE solution, because it has to be corrected for every locale.