Skip to content
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

Currency validator rule #651

Closed
stevenjlho opened this issue Apr 14, 2017 · 3 comments · Fixed by #713
Closed

Currency validator rule #651

stevenjlho opened this issue Apr 14, 2017 · 3 comments · Fixed by #713

Comments

@stevenjlho
Copy link

isCurrency is only accept two digits after decimal_separator. For example, 100.50 is valid, but 100.5 is not valid.
I think this rule do not force one digit or two digits after decimal_separator.

@stevenjlho stevenjlho changed the title currency validator rule Currency validator rule Apr 14, 2017
@regularmike
Copy link

I believe it currently accepts 0 or 2 places. One place seems to be extremely rare as a standard, although it may exist (Macanese pataca?). Also, there seem to be plenty of examples of 3-decimal-place standards. Maybe this should be a new option that is an array of acceptable numbers of decimal places, defaulting to [0, 2]. I could add this in the next few days unless someone else wants to tackle.

@stevenjlho
Copy link
Author

I agree with you. Add a new option is a good point.

@regularmike
Copy link

@chriso does this sound reasonable? It should definitely support 0 to 3 places according to the ISO standard. I'm not sure if any country officially allows more than one number of decimal places (e.g. 0 or 2) but I can imagine users of this library may want that option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants