How to include commas as per currency format in the Totals ie footer
How to include commas as per currency format in the Totals ie footer
rocky2016
Posts: 11Questions: 6Answers: 0
I'm using Datatable api to calculate and display sum(total) in the footer. But how can I format it to curreny and commas.
{{total | currency:'USD':true:'1.2-2'}}, I cant use this as I'll be using api $( api.column( 1 ).footer() ).html(
'$'+total
);
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You need to render it yourself. You can actually use the built in renderer to do it:
Allan
This worked exactly,
$.fn.dataTable.render.number(',','.','2','$').display(total)