You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
stevenjlho
changed the title
currency validator rule
Currency validator rule
Apr 14, 2017
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.
@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.
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.
The text was updated successfully, but these errors were encountered: