Success! Looks like we've fixed this one. According to our records the fix was applied for EXTGWT-2862 in a recent build.
  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    88
    Vote Rating
    3
    esag_dk is on a distinguished road

      0  

    Default NumberField - groupSeparator converted into a comma

    NumberField - groupSeparator converted into a comma


    There is a strange NumberField behavior in 3.0.1.

    1. Set decimal number format (1.234.567,123 - german/non-U.K. notation with a group separator and a comma).
    2. Enter a number which requires ONE group separator, e.g. 1000
    3. Leave the NumberField -> the number is formatted correctly (1.000)
    4. Enter the NumberField again and add a digit (e.g. 11.000 or 1.1000)
    5. Leave the NumberField -> The group separator now is interpreted as a comma -> 11 or 1
    6. This does NOT happen, if you choose a number which has more than one group separator (e.g. 123.456.789)

    I couldn't find the reason for that bug, but it makes the field unusable with a group separator formatting.

    I've also tried using custom formats as a workaround:
    - NumberFormat.getFormat("0,000.##") - this is even worse: 1.000 -> 11.000 = 0.011
    - NumberFormat.getFormat("#,##0.00") - this works fine, but enforces 2 decimal places, which is not our desired behavior


    Code:
    public class GXT_3_0 implements EntryPoint {
    
        public void onModuleLoad() {
            RootPanel.get().add(createMainPanel());
        }
    
        private Container createMainPanel() {
            VerticalLayoutContainer vlc = new VerticalLayoutContainer();
            vlc.setBorders(true);
            vlc.setPixelSize(300, 100);
    
    
            final NumberField<Double> field = new NumberField<Double>(new DoublePropertyEditor(NumberFormat.getDecimalFormat()));
            vlc.add(field);
            
            return vlc;
        }
    }

  2. #2
    Sencha User
    Join Date
    Nov 2011
    Posts
    10
    Vote Rating
    0
    Tony Stuart is on a distinguished road

      0  

    Default


    To workaround the problem, override DoublePropertyEditor and provide your own implementation of parseString that invokes the parse method on the supplied format:

    Code:
    public class Test implements EntryPoint {
    
      public class MyDoublePropertyEditor extends DoublePropertyEditor {
    
        public MyDoublePropertyEditor(NumberFormat numberFormat) {
          super(numberFormat);
        }
    
        @Override
        protected Double parseString(String string) {
          Double value = format.parse(string);
          return value;
        }
    
      }
    
      public void onModuleLoad() {
        RootPanel.get().add(createMainPanel());
      }
    
      private Container createMainPanel() {
        VerticalLayoutContainer vlc = new VerticalLayoutContainer();
        vlc.setBorders(true);
        vlc.setPixelSize(300, 100);
    
        NumberFormat decimalFormat = NumberFormat.getDecimalFormat();
        DoublePropertyEditor editor = new MyDoublePropertyEditor(decimalFormat);
        final NumberField<Double> field = new NumberField<Double>(editor);
        vlc.add(field);
    
        return vlc;
      }
    }

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    88
    Vote Rating
    3
    esag_dk is on a distinguished road

      0  

    Default


    Thanks for this workaround!

  4. #4
    Sencha User
    Join Date
    Oct 2013
    Posts
    1
    Vote Rating
    0
    mendoanloper is on a distinguished road

      0  

    Default Numberfiled show different values ​​inputted more than 23 digits

    Numberfiled show different values ​​inputted more than 23 digits


    I have problem if I using format inputted values ​​over 10000000000000000000000
    when the cursor moved / lost focus will display the different values ​​into 9999999999991611.00


    errordisplayvaluenumberfield.png

  5. #5
    Sencha User
    Join Date
    Jul 2011
    Posts
    138
    Vote Rating
    13
    Andreas Samjeske will become famous soon enough

      0  

    Default


    @Tony: thanks.

    @Colin: Again, there is no info in which version this issue has been fixed.

    @ mendoanloper: Did you ever here of loss of significance ?