numeric input field without the arrows

The following example shows an numeric input field.


Is there anyway to turn off the arrows? The problem they cause is for precision data. If 1.22 is entered in the field and the user accidently touches the up arrow, the value is changed to 2 with the .22 being lost.

Second question: formatting the field to 2 decimals precision. It seems that the .toFixed(2) method is not supported. The editor suggests it, but afterwards there is an error displayed that β€œ.toFixed()” is not a function.

1 Like

Hey Kevin,

The β€œeasy” way to solve both problems is to set the field type to text, and then add this regex pattern validation: ^\d+(?:.\d{2})?$
This expression requires two digits to be present after the decimal point since that would be consistent with the idea of precision.

If you don’t require digits after the decimal point: ^\d+.?\d{0,2}$

I hope that helps.

Yisrael