I have an application that is multilingual. I have a simple model like this
public class Product
{
public string Name { get; set; }
public decimal Price{ get; set; }
}
I set CurrentCulture to a culture that has different decimal separator like French "fr-FR" (in french decimal separator is , ). In my Create Page when I put a number like 655,20 for price I got a javascript validation error that says:
The field Price must be a number.
When I change CurrentCulture to en-Us I can submit my form.
You can use the Globalisation Nuget Package (globalize.js) which works with jQuery. Alternatively you can override the $.validator.methods.number method to allow an alternative decimal separator For an example refer this blog.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With