zopefoundation / z3c.form

An advanced form and widget framework for Zope 3
Other
8 stars 39 forks source link

field type: floating-point number should accept computerees for large and small numbers... #47

Open gutow opened 8 years ago

gutow commented 8 years ago

Python and most calculators accept numbers in the format X.XXXeYY for representing scientific notation in a compact manner. I believe the input checking on floating-point numbers should accept that format as well.

The problem appears to be with the javascript checking of the input field. Try entering something like "1.1e10" into any dexterity float field in the edit view. You will get the red box around it with this error: "The entered value is not a valid decimal literal."

The validation appears to only accept digits and 1 decimal point. This is Plone 5.04. No errors are logged as the js checking does not allow submission. I do not think that standard X.XeYY notation will cause a problem if submitted. Display of computed fields that yield large numbers do default to scientific notation.