Formatted numbers with $.fn.dataTable.render.number are not negative anymore
Formatted numbers with $.fn.dataTable.render.number are not negative anymore
Floux
Posts: 3Questions: 0Answers: 0
Hi,
I do not know if I missed something or if this is a bug but when I format numbers with $.fn.dataTable.render.number the negative symbol "-" disappears.
Here my table configuration :
campagnes.DataTable({
data: dataSet,
deferRender: true,
fixedHeader: true,
columnDefs: [
{targets: 7, render: $.fn.dataTable.render.number( ' ', ',', 2, '', ' €' ) },
{targets: [5,6], render: $.fn.dataTable.render.number( ' ', ',', 0, '', ' €' ) },
{targets: [3,4,5,6,7], className: 'text-right'},
{targets: [1,8,9,10], className: 'text-left'}
]
});
Thanks for your help !
This discussion has been closed.
Replies
Can you link to the page showing the issue please.
Allan
Thanks for your fast reply, here is a static copy of the page where the problem occurs :
http://foulquesdupeloux.no-ip.org/datatable/
I think the issue might be that you aren't actually passing a number into the formatter - but rather a string like
"-3406 €",
. Why pass that through the formatter - it is already formatted?Allan
Thanks you were right, I deleted '€' symbols from the data source to have real numbers and it worked.