Restrict decimal point to one

Maybe the search function of this forum can help you, incl. examples, see https://forum.getodk.org/search?q=regex%20decimal%20digits, esp. Regex on decimal numbers with .0 e.g. 38.0.

Hints:
As far as I know, for decimal type, you cannot avoid that 12.0 will finally be shown as 12. (Also, this is mathematically the same value.)

You cannot restrict directly inside/during the field entry, only after the focus is moved outside (check via constraint).

For regex constraints, you can find more here: https://docs.getodk.org/form-regex. You can use a decimal or integer type and cast it with string(${myNumberVar}) for the regex expression.

2 Likes