PDA

View Full Version : numbercolumn format



EPV
3 Apr 2012, 7:31 AM
I have:



{
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

carol.ext
3 Apr 2012, 8:50 AM
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?

EPV
4 Apr 2012, 1:08 AM
Great, thanks!

I put the following in a locale.js file:



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