I want to constrain the input of a number that is 1-7 numbers, a decimal point, and one number after the decimal point. If the number after the decimal point is zero it doesn't validate.
I've tried
regex(.,'^\d{1,7}\.\d{1}$')
regex(.,'^[0-9]{1,7}\.[0-9]{1}$')
123.0 - invalid
1234567.9 - valid
1.0 - invalid
1.1 - valid
Solved! Go to Solution.
Hi Mike,
I am able to use your second function with a text question for all the examples you provided. A decimal question also validated all but the '123.0' test case - this is because it would be stored as 123
Hi Mike,
I am able to use your second function with a text question for all the examples you provided. A decimal question also validated all but the '123.0' test case - this is because it would be stored as 123
I had the type set to decimal. When I set it to text the regex worked. I adjusted my formulas to convert the value to number and the output is what I would expect to see.