An end user asked me about a custom decimal field that for some reason only accepts integers even though in schema config it is set as type “BigDecimal” just like adjacent fields that behave differently:
The end user also asked if the field could be changed so that one can choose different units like meters, centimeters or milimeters. Is this even possible at all?
This issue was identified internally and is caused by the browser assuming the default step value for a numeric input field should be 1 unless otherwise stated. This means that it expects the field to be a whole integer upon initial validation.
I can recreate the issue on my end using v7.9.3.1:
This issue is fixed in version v7.9.4, which will be released very soon.
In the meantime, you should be able to select and deselect the field, and the error will be dismissed. Specify then checks the field and dismisses the browser’s warning. If you are seeing a different behavior, please let me know!
You can also configure the step attribute in the XML form definition to set the precision to override this issue (in Specify 7.7 or newer):
BTW The end user also asked if the field could be changed so that one can choose different units like meters, centimeters or milimeters using a dropdownlist. Is this even possible at all?
Unfortunately, this is not possible at this time. The unit can be specified in another text field, such as a pick list to control the allowed terms, but it cannot be stored as metadata in the decimal field itself or indicated in the form definition.