Skip to content

Is there a way to round the avg format for the footer row?

You can manually calculate the average using sum/count and round it with javascript Math.round function.

function ()
{
    var colSum = $('#customers').jqGrid('getCol', 'creditLimit', false, 'sum');
    var reccount = jQuery("#customers").jqGrid('getGridParam', 'reccount');
    var avg = Math.round(colSum/reccount * 100/100);

    $('#customers').jqGrid('footerData', 'set', { state: 'Avg:', 'creditLimit': avg });
}

Feedback and Knowledge Base