Avoiding "$" in column sum
Avoiding "$" in column sum

I have the next code for showing the total below the table:
"footerCallback": function ( row, data, start, end, display ) {
total = this.api()
.column(4)//numero de columna a sumar
//.column(1, {page: 'current'})//para sumar solo la pagina actual
.data()
.reduce(function (a, b) {
return parseFloat(a) + parseFloat(b);
}, 0 );
console.log(total);
$(this.api().column(4).footer()).html("ss"+total);
},
but i have currency formatting the colum:
return "$" + row.importe;
What can i do to sume the numbers, if i use parseFloat it don'tn funciton because of the symbol.
This discussion has been closed.
Answers
Hi @giulichajari ,
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Take a look at the footercallback example to see how to do this.
Kevin