DataTables - Total rowCount - How to cut euro sign in the columns?
- by Ivan M
For my DataTable I'm using the fnFooterCallback function to display the total amount of the column, which is working untill the columns contain a special character, like in this case a euro valuta sign.
How can I adjust this code so it will not detect the euro sign?
"fnFooterCallback": function ( nRow, aaData, iStart, iEnd, aiDisplay ) {
/*
* Calculate the total market share for all browsers in this table (ie inc. outside
* the pagination)
*/
var iTotal = 0;
for ( var i=0 ; i<aaData.length ; i++ )
{
iTotal += aaData[i][7]*1;
}
/* Calculate the market share for browsers on this page */
var iPage = 0;
for ( var i=iStart ; i<iEnd ; i++ )
{
iPage += aaData[ aiDisplay[i] ][7]*1;
}
/* Modify the footer row to match what we want */
var nCells = nRow.getElementsByTagName('th');
nCells[1].innerHTML = parseInt(iPage);
}
Thank you in advance.
EDIT
With not detecting I mean to str_replace or something like that. Not familiar with javascript language..