1

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

  • When you say 3 integers and 3 decimals, do you mean one number formatted like this? – Martin Lezer Jun 12 '17 at 8:44
  • yes, a number formatted like 123.456 or 12.345 or 12,3 etc... – user45926 Jun 12 '17 at 8:55
  • 1
    You should probably use the ui:inputNumber instead of the lightning:input. And specify a format on the specific attribute. – Martin Lezer Jun 12 '17 at 9:39
  • i was order to use lightnint:input :/ – user45926 Jun 12 '17 at 11:05
0

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}))?$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.