You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using the library to generate forms to configure scientific algorithms, and users are often typing numbers looking like 0.00xxx.
The issue is that while trying to enter a floating number with a 0 after the decimal point, the decimal point and 0 part gets removed.
Some examples:
if I type 1.23, no issues, I see the value 1.23 in the input field
if I type 1.0, the .0 gets removed, I see the value 1 in the field
if I type 1.023, the .0 part gets removed as soon as I typed it, I see the value 123 in the field
This is getting really confusing for our users, as the only way the enter the desired value right now would be to type 1.23 and then go back to add the 0 after the point, which is not ideal. And if they don't pay attention, they could end up with values that are completely incorrect, which would then be used in their computations.
Are there any fix or workaround available for that issue?
The text was updated successfully, but these errors were encountered:
There is no difference between 1 and 1.0, so no matter how ngx-schema-form handles it, if we use a number field and the entered value is 1.0, we will get 1 as a resulting value.
I am afraid the only way to manage it is to use a string field, so the value will be "1.0" (you can implement a FloatStringWidget widget that would render a <input type="number"> to make sure users only enters numeric values), and then your backend will have to convert it into a float.
For me, this is working correctly when I change input's attribute from [attr.type]="'number'" to type="number" in the template of IntegerWidget. (projects/schema-form/src/lib/defaultwidgets/integer/integer.widget.ts:17).
When I use type="number", the type of control's value is correctly interpreted as number. The other syntax gives string representation which is causing the problem. One would expect both syntaxes should produce the same result yielding number. It looks like a bug in angular.
We are using the library to generate forms to configure scientific algorithms, and users are often typing numbers looking like
0.00xxx
.The issue is that while trying to enter a floating number with a
0
after the decimal point, the decimal point and0
part gets removed.Some examples:
1.23
, no issues, I see the value1.23
in the input field1.0
, the.0
gets removed, I see the value1
in the field1.023
, the.0
part gets removed as soon as I typed it, I see the value123
in the fieldThis is getting really confusing for our users, as the only way the enter the desired value right now would be to type
1.23
and then go back to add the 0 after the point, which is not ideal. And if they don't pay attention, they could end up with values that are completely incorrect, which would then be used in their computations.Are there any fix or workaround available for that issue?
The text was updated successfully, but these errors were encountered: