I am looking to add a summation row to my rails application that is using Datatables.
My data is being presented with a comma as is 999,999
I noticed that this code:
$('#example').dataTable( {
"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
var TotalMarks = 0;
for ( var i=0 ; i<aaData.length ; i++ )
{
TotalMarks += aaData[i][12]*1;
}
var nCells = nRow.getElementsByTagName('th');
nCells[1].innerHTML = TotalMarks;
}
});
will only add up if I remove the (,). Is there a way to have it added with the (,) still in place?