We use the expression regex(., '^\d{0,2}(?:\.\d)?$') in the constraint column for a field where we want to drop the trailing decimal and zero from a value, but only when the number after the decimal is a zero. For example the input value of 255.0 would return 255, the input value of 82.0 would return 82, and the input value of 129.1 would return 129.1. This has been working well, but after the software version on our device was updated from 3.16 to 3.17 we now get an invalid value error when the input value is xxx.0, xxx.x but not xx.0. The data type for the output field is set to decimal. We would like to continue using the regex - is there a way around the invalid error?
Does this work? regex(., '^\d+(?:\.\d)?$)