New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decimal mark (dot or comma) #1232
Comments
Good idea. In every project I have to overwrite the following methods by loading custom script after jquery-validation: |
Changing number to allow also floats would be a BC break. Also adding floats would require to know which sign is the separator, sometimes its comma, sometimes its a dot -> l10n |
Hmm just read the html5 spec, which defines it to allow floating numbers. Therefore it seems we need to change that for spec compilance Could you PR a unit test and your patch? |
Would adding two options (decimal-mark, thousand-mark) with default values be a bad idea? |
I re-read your initial post. I didn't got what you mean at first. I think we should decide which separator to use based on a locale, maybe even with a override using a parameter/config-option |
Sorry if I wasn't clear enough. Glad you know what I meant. When you mention locales, I immediately think about Microsoft's jQuery Globalization, but I just heard the name and have no experience with that, so it's up to you how this thing should be handled. |
this stuff can be done with globalize and https://github.com/johnnyreilly/jquery-validation-globalize |
This number method implementation in src/localization/methods_de.js does that. You could just use that implementation, with whatever locale uses the same format. Eventually this will get addressed by #581, but that will likely still take a while. As mentioned there and in the comment above, the jquery-validation-globalize project can be used right now. |
The number type doesn't accept comma as decimal mark, only dot. 40% percent of people are forced then to modify the plugin or write custom rules.
Parameter would be very cool.
The text was updated successfully, but these errors were encountered: