Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    FloatItem.getValueAsFloat should use NumberUtil.parseFloat instead of generic parseFloat

    Hi,

    Shouldn't FloatItem.getValueAsFloat recognize floats formatted with locale instead of default JS parseFloat function?

    Best regards,
    Janusz
    Last edited by janusz; 9 Aug 2017, 13:58.

    #2
    FloatItem's have type "float" by default, so it's correct to use parseFloat() by default - in cases where the type is "localeFloat", the value has already been run through locale-sensitive parsing on change, etc.

    However, it's theoretically possible for application code to call this method mid-edit, from a change handler for example, so we've updated the method to use locale-sensitive parsing if type is "localeFloat", just in case.
    Last edited by Isomorphic; 10 Aug 2017, 23:55.

    Comment

    Working...
    X