Decimal input

Dear Team
I want to restrict decimal value upto 2 digit only is there any way to do this.

Thanks

Hello Rakesh_Ranjan,

Use a regular expression (https://docs.opendatakit.org/form-regex) as a constraint.

Use regex (.,'^[0-9]{2}') It should work for your case.

Regards,
Dinesh Dongol

1 Like

Strictly speaking you also need the end-of-line tag, otherwise "12345" will match. And, if "up to 2 digits" means that "1" is OK, then try this:

regex(.,'^[0-9]{1,2}$')

BTW, you can test regex's here


  1. 0-9 ↩ī¸Ž

1 Like