1. #1
    Sencha Premium Member EPV's Avatar
    Join Date
    Dec 2010
    Location
    Sweden
    Posts
    175
    Answers
    23
    Vote Rating
    13
    EPV will become famous soon enough

      0  

    Default Answered: numbercolumn format

    Answered: numbercolumn format


    I have:

    Code:
    {
       header:'Test',   
       xtype: 'numbercolumn',
       format:'0.000,00/i',
       dataIndex:'XXX'                
    }
    - The input in the store is 12345.6789
    - The type of the field in the model is float
    - I want to show 12.345,68 in the grid

    Seems I've tried every combination of the format property but can't get it to work.

    Ext version 4.0.7

    Any ideas? Thanks /E

  2. A quick look at the code shows it uses Ext.util.Format to do the formatting.

    Looking around Ext.util.Format documentation it says you can override the thousand and decimal separators in a locale file. Have you done that?

    thousandSeparator : String

    The character that the number function uses as a thousand separator.

    This may be overridden in a locale file.

    Defaults to: ","
    If that's not the issue, have you tried debugging to see where it is going wrong?

  3. #2
    Sencha User carol.ext's Avatar
    Join Date
    Jun 2007
    Location
    Littleton, Colorado, USA
    Posts
    671
    Answers
    16
    Vote Rating
    20
    carol.ext will become famous soon enough carol.ext will become famous soon enough

      0  

    Default


    A quick look at the code shows it uses Ext.util.Format to do the formatting.

    Looking around Ext.util.Format documentation it says you can override the thousand and decimal separators in a locale file. Have you done that?

    thousandSeparator : String

    The character that the number function uses as a thousand separator.

    This may be overridden in a locale file.

    Defaults to: ","
    If that's not the issue, have you tried debugging to see where it is going wrong?

  4. #3
    Sencha Premium Member EPV's Avatar
    Join Date
    Dec 2010
    Location
    Sweden
    Posts
    175
    Answers
    23
    Vote Rating
    13
    EPV will become famous soon enough

      0  

    Default


    Great, thanks!

    I put the following in a locale.js file:

    Code:
    if(Ext.util.Format){    Ext.apply(Ext.util.Format, {
            thousandSeparator: '.',
            decimalSeparator: ','
        });
    }

Thread Participants: 1