Announcement

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

    Issue with decimalSymbol

    Given this example for version v12.0p_2019-12-31/LGPL Development Only (2019-12-31):

    Code:
    isc.NumberUtil.addClassProperties({
      // change to "." and "," respectively will make it work correct again
      decimalSymbol: ',',
      groupingSymbol: '.'
    });
    
    isc.DynamicForm.create({
      autoFocus: true,
      fields: [
        { defaultValue: 1234.56789, format: ',0.00000', type: 'localeFloat', title: 'localeFloat' },
        // optional fields that work correctly with both decimal symbols
        { defaultValue: 1234.56789, format: ',0.00000', type: 'float', title: 'float' },
        { defaultValue: 1234.56789, format: ',0.00000', type: 'decimal', title: 'decimal' }
      ]
    });
    Using the localeFloat type and setting decimalSymbol in the NumberUtil class to "," causes the 3th and consecutive decimals to disappear when focusing the item. This does not happen for float and decimal types. And - more important - not when the decimalSymbol is "." (the default).

    With decimalSymbol set to "," (incorrect):
    Click image for larger version

Name:	incorrect.png
Views:	120
Size:	9.0 KB
ID:	260692
    With decimalSymbol set to "." (correct):
    Click image for larger version

Name:	correct.png
Views:	83
Size:	9.8 KB
ID:	260693

    #2
    In addition to this, I've tried to use a "float" type (instead of "localeFloat"), with decimalSymbol "," and groupingSymbol ".". Then, the field shows the correct value, but when it receives focus, it shows an incorrect format (using "." as decimalSymbol and an empty grouping symbol (but that's okay).

    In general, are there much benefits in using localeFloat, localeInt and localeCurrency? Can't the same be achieved using the "format" property?

    Comment


      #3
      localeFloat/Int/Currency automatically use the appropriate symbols when you load a locale, so you don't have to set the format manually for every locale.

      We'll check on the reported misbehavior.

      Comment


        #4
        We've fixed this issue for builds dated January 12 and later.

        Comment


          #5
          It seems to be working now, thank you very much!

          Comment

          Working...
          X