I would like a pattern for decimal number in paper-input for following outpus:
111.111,11 >>> true
111,11 >>> true
0,11 >>> true
I am using the following pattern:
"^([0-9]{1,3}\.)?[0-9]{1,3}\,[0-9]{2}$?"
in the code:
<paper-input type="number" pattern="^([0-9]{1,3}\.)?[0-9]{1,3}\,[0-9]{2}$?" auto-validate error-message="Não é um número válido!" label="Faturamento Anual" value="{{parametro.faturamentoAnual}}"><div prefix>R$</div></paper-input>
But when I type 0,11 and return false with the error-message.
Is there a different pattern to decimal number in paper-input that works?
The ? at the end of your regex doesn't make sense to me.
I tried it without the ? and it worked fine.
I also had to remove type=number to be able to enter anything at all.
A plain <input type="number"> doesn't allow , or . as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With