Get exact input from Number input
Is there a way to get the exact text a user types into a Number input? If I type 1.0000, the value property returns 1 (as a number) and the display property returns "1" (as a string). I have set Precision to 4, but that does not seem to make any difference.
I have a requirement where a certain minimum amount of decimals must be entered, and if possible at all, I'd prefer to use the Number input rather than Text Box.
-
I think you mean Text Box and not Text?
1 -
Exactly, Nico
0 -
This looks like a bug. The display property should have a value of "1.0000" in that case. I'm working on the numeric form elements now. We can fix that.
0 -
Thanks, let me know if you need more information.
If it matters, my settings are Dutch, so I have 1,0000 not 1.0000
0 -
Berend Veldkamp I did an experiment with the Number Slider, and it behaves as I expect the Number input should. With a precision of 4 and locale of "nl", a value of 1 has a display attribute of "1,0000".
I just need to make sure to use the same logic in the Number form element.
0 -
Hi Ken, could you please let us know if this bug will be fixed in the 5.34 release the coming month? This will prevent us to make something on our own in the Text Box (and time of course).
0 -
Bart Middelburg The Workflow 5.34 release next week will fix the number of decimal places shown in the "display" property of the Number form element's value. The release notes might not call it out specifically, but we will have a fairly prominent entry explaining that all form elements have been migrated to use new Material UI components.
Note that the issue of respecting the current culture's decimal separator has not been addressed. I thought I had a fix for that but it only worked in Firefox. We plan to switch to a different component soon that will work for Chrome as well but that will be after this release.
1 -
Thanks Ken!
0
Du måste logga in om du vill lämna en kommentar.
Kommentarer
8 kommentarer