I am using:
groupModel: {
on: true,
header: false,
grandSummary: true,
agg: {"PRICE":"sum"}
},
summaryTitle:{sum:""},
The issue is that long decimals come from the server data which are converted to the correct currency (thus many decimal places needed) and rounded in the colModel.render which is all fine. However when if I lets say get three PRICE values of 1.004, 1.004, 1.004, the total is 3.012 which rounds to 3.01 which is wrong as it should be 3.00 (1.00 + 1.00 + 1.00) as each row was rounded to 1.00.
How do I override the sum function, or add a custom sum function to round before adding each cell in the grouped column? Also the cell needs to be rounded for Excel output due to the same issue in spreadsheet apps.
I've tried below but it doesn't work:
formulas: [
[
"sum",
function(rd)
{
return Math.round(rd.cellData * 100) / 100;
}
]
],