I am trying to show the comma to show thousands, for example total showing 120000 should be 120,000.
Here is the code amended from the example, (Footer Call back example) but it is not giving me what I want. I would be grateful if anyone could show me who to amend the code.
```
(document).ready(function() {
$('#example').DataTable( {
"paging": true,
"autoWidth": true,
"language": "",
"decimal": ",",
"thousands": ".",
"footerCallback": function ( row, data, start, end, display ) {
var api = this.api(), data;
// Remove the formatting to get integer data for summation
var intVal = function ( i ) {
return typeof i === 'string' ?
i.replace(/[\$,]/g, '')*1 :
typeof i === 'number' ?
i : 0;
};
// Total over all pages
total = api
.column( 2 )
.data()
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
// Total over this page
pageTotal = api
.column( 2, { page: 'current'} )
.data()
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
// Update footer
$( api.column( 2 ).footer() ).html(
pageTotal +' ( '+ total +' total)'
);
total = api
.column( 3 )
.data()
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
// Total over this page
pageTotal = api
.column( 3, { page: 'current'} )
.data()
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
// Update footer
$( api.column( 3 ).footer() ).html(
'£'+pageTotal +' ( £'+ total +' total)'
);
}
} );
} );