1. #1
    Ext User Pmithrandir's Avatar
    Join Date
    Sep 2008
    Location
    Rennes - France
    Posts
    40
    Vote Rating
    0
    Pmithrandir is on a distinguished road

      0  

    Default NumberField with , for decimal separator

    NumberField with , for decimal separator


    Hello

    We are french, but our application must recognize any number format. (. for english user and , for french user.)

    We use the code above to configure our NumberField, but the "," is not recognized.
    Code:
    texteDouble = new NumberField();
    texteDouble.setFieldLabel("double");
    texteDouble.setAllowBlank(false);
    texteDouble.setFormat(NumberFormat.getCurrencyFormat());
    Is this a possibility to use "," on NumberField ?

    And more, is this a possibility to transform . (num keybord) to , on the screen ?

    Thanks

    Pierre

  2. #2
    Ext User
    Join Date
    Oct 2008
    Location
    Atlanta ,GA
    Posts
    239
    Vote Rating
    0
    kolli is on a distinguished road

      0  

    Default


    numberField.setDecimalSeparator(","); have u not checkd this?

  3. #3
    Ext User Pmithrandir's Avatar
    Join Date
    Sep 2008
    Location
    Rennes - France
    Posts
    40
    Vote Rating
    0
    Pmithrandir is on a distinguished road

      0  

    Default


    Hello

    I can't use the decimal format, or i must list all locale to set separator manualy...

    I prefer to use the existent function
    Code:
    texteDouble.setFormat(NumberFormat.getDecimalFormat());
    but no effect.

  4. #4
    Ext User
    Join Date
    Oct 2008
    Location
    Atlanta ,GA
    Posts
    239
    Vote Rating
    0
    kolli is on a distinguished road

      0  

    Default


    but even if you are using
    Quote Originally Posted by Pmithrandir View Post
    Code:
    texteDouble.setFormat(NumberFormat.getDecimalFormat());
    you need to specify when you are using ", " or when you are using "."

  5. #5
    Ext User Pmithrandir's Avatar
    Join Date
    Sep 2008
    Location
    Rennes - France
    Posts
    40
    Vote Rating
    0
    Pmithrandir is on a distinguished road

      0  

    Default


    If I specify the format of the cell, it's to use the default local format.

    Why have I to re-specify manualy the format ?

    Pierre

Thread Participants: 1