Express number attribute doesn't allow decimal values
Permalink
I created an attribute named "Amount" for a "Donation" entity. I chose the "Number" type. But the forms don't allow entry of a decimal value. E.g. the value "25.52" shows a validation message of "Please enter a valid value. The two nearest valid values are 25 and 26.
Is there a way to allow decimal values? Should I have used a different attribute type?
Is there a way to allow decimal values? Should I have used a different attribute type?
I tried this out and it works with some quirks. Anyway, I don't imagine you intended this to be a permanent fix. Better to make it a text field and somehow introduce some custom validation. Although, I don't like that either.
What I would really like to know is whether this is the expected behavior. Is the "Number" attribute type really supposed to represent an integer value and unsuitable for storing currency or decimal values? If so, are there plans to introduce a suitable attribute for the purpose?
Andrew Embler, could you comment please?
What I would really like to know is whether this is the expected behavior. Is the "Number" attribute type really supposed to represent an integer value and unsuitable for storing currency or decimal values? If so, are there plans to introduce a suitable attribute for the purpose?
Andrew Embler, could you comment please?
I can confirm this in Chrome and Firefox on Windows using the latest GitHub develop branch.
With MS Edge, you don't get the spinner control but you do get the validation error.
This adds step="any" to the number input which makes it accept any values, not just whole numbers.