PDA

View Full Version : Grid Summery Bug



ghezeli
4 Nov 2013, 1:09 AM
hi to all

when i user grid summry in my code :


features : [{
ftype: 'summary',
dock: 'bottom'
}],

columns: [
{
text : 'MWH1',
dataIndex: 'w1',
width: 120,
summaryType: 'sum',
}
]

the result is not correctly , the sum of columns must be '553.3'
but it has '553.300000000001'
plz help me
tnx

Piruthu
4 Nov 2013, 2:10 AM
use summaryRenderer and format number (http://docs.extjs.com/extjs/4.2.1/#!/api/Ext.util.Format-method-number) to required precision


summaryRenderer: function(value) {
return Ext.util.Format.number(value, '0.0');
}