Is your feature request related to a problem? Please describe.
I would like to allow my inputs to have only decimal values.
E.g.
Important: It should be possible to choose, whether . or , is used as separator.
Describe the solution you'd like
In the past there was a rule decimal - but it is no longer available.
You can implement it as a custom rule.
On Wed, Oct 30, 2019, 10:28 AM SPQRInc notifications@github.com wrote:
Is your feature request related to a problem? Please describe.
I would like to allow my inputs to have only decimal values.E.g.
- 1.2
- 0.1
Important: It should be possible to choose, whether . or , is used as
separator.Describe the solution you'd like
In the past there was a rule decimal - but it is no longer available.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/logaretm/vee-validate/issues/2463?email_source=notifications&email_token=ABPYUSR3WCV7KO3TPDORL5DQRFATZA5CNFSM4JGVIXL2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HVKLAQA,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABPYUSXU34CCKSPNZDEVAS3QRFATZANCNFSM4JGVIXLQ
.
I'm curious why this rule got removed in v3?
Cause it was being confused with integer and numeric most of the time and because it had two different error messages which made it harder to build a library-agnostic i18n interface.
It could be introduced back in the future.
Alright, thank you. So could I adopt https://github.com/logaretm/vee-validate/blob/2.2.15/src/rules/decimal.js for that?
Yep, you can do that.
IMHO - you shouldn't have to roll your own solution for something that is as critical as this...
IMHO - you shouldn't have to roll your own solution for something that is as critical as this...
@aaronksaunders Well, "critical" is subjective. I'm working in a company that builds e-commerce solutions and did my fair number of building dashboards with huge forms. I have yet to add a single input that accepts comma separators or even decimal points, I know this proves nothing but it certainly says its a niche case.
And rolling your own is just a few lines of code, nothing major. But adding it to everyone else is a major decision.
If you think about what vee-validate offers, its not really validation rules. It's more about providing declarative form validation solution regardless of the used UI library or (native inputs vs components), so the available rules and their capabilities are like the cherry on top and will have to stay in check.
I know this is closed, but just wanted to add that if this is the case (decimal being removed from rules) could the docs please be updated? I had to come here to find out. Although I can see that the docs are for v2, so apologies if there are docs for v3 coming out or if the current one is to be updated.
Most helpful comment
Cause it was being confused with
integerandnumericmost of the time and because it had two different error messages which made it harder to build a library-agnostic i18n interface.It could be introduced back in the future.