validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

Feature Request: Currency: Option to Require Thousands Separator

Open OlllllllO opened this issue 6 years ago • 7 comments

We're using this to help validate data that includes currency. We want to make sure that a comma separator is always present.

OlllllllO avatar Oct 15 '18 23:10 OlllllllO

There's an pull request open to resolve that issue: #945

Maxim-Mazurok avatar Nov 30 '18 22:11 Maxim-Mazurok

Thanks @Maxim-Mazurok, will review and get back 👍

profnandaa avatar Dec 07 '18 13:12 profnandaa

@profnandaa - hello. any update on when this feature will get merged in? thanks.

OlllllllO avatar Dec 04 '20 20:12 OlllllllO

IDK why this PR wasn't merged: https://github.com/validatorjs/validator.js/pull/1084 It looks like a totally valid approach to me. There's no such thing as too many options, especially when people asked for this option... IMO

Maxim-Mazurok avatar Dec 05 '20 01:12 Maxim-Mazurok

#1084 was closed without getting merged and it seems that this feature just got lost in the mix. Any chance of revisiting?

OlllllllO avatar Dec 10 '20 00:12 OlllllllO

Hey, i am looking for my first contribution in open source. Can anyone guide me with this issue i would i like to work on it

sanchit36 avatar Jan 14 '22 17:01 sanchit36

Hey, i am looking for my first contribution in open source. Can anyone guide me with this issue i would i like to work on it

#1084 solved this issue already, but the choice was made by the maintainers to reject that approach in search for a larger refactor of isCurrency which would limit the amount of options that is possible. One option that would involve this thousands separator is to merge the allow_ and require_ options so it's not a Boolean but allows a few options. My idea would be something like; required, allowed/optional, forbidden. But feel free to suggest a different wording. This way we can reduce the total amount of options slightly and add this requested functionality. For implementation you can check out the above-mentioned PR

WikiRik avatar Jan 14 '22 17:01 WikiRik