how i can have a field (lightning:input) in which i can write 3 integer and 3 decimal? Something like 123.456 (max 3 integer and max 3 decimal, with "." or "," between integer and decimal). I try to use the attribute pattern, but i don't have good results. Thanks for help in advice
1 Answer
Try this pattern,
^([1-9]{0,1})([1-9]{0,1})([0-9]{1})((\.[0-9]{0,1})([0-9]{1})|(\,[0-9]{0,1})([0-9]{1}))(([0-9]{1}))?$
-
3This pattern doesn't work for numbers like "100". How about
^\d{1,3}(?:(\.|\,)\d{1,3})?$
? It's much less verbose.– nbrownCommented Apr 23, 2020 at 14:59
ui:inputNumber
as it has been deprecated by Salesforce.