formatting on "sAjaxSource": "server_processing.php",
formatting on "sAjaxSource": "server_processing.php",
diogenes
Posts: 1Questions: 0Answers: 0
I need to format the numbers on my tables in many ways - example adding commas and rounding the decimal places.
using the code i saw that you posted gives me a lot of different output:
45,647,6.4
13,159,.99
Also what about output options for dates from the yyyy-mm-dd SQL?
you have done some great work and I sincerely appreciate you pointing me in the right direction!!! Cheers.
$('#example').dataTable( {
"aoColumnDefs": [
{
"aTargets": [ 0 ],
"bUseRendered": false,
"fnRender": function ( o ) {
return o.oSettings.fnFormatNumber( parseFloat( o.aData[ o.iDataColumn ] ) );
}
}
]
} );
using the code i saw that you posted gives me a lot of different output:
45,647,6.4
13,159,.99
Also what about output options for dates from the yyyy-mm-dd SQL?
you have done some great work and I sincerely appreciate you pointing me in the right direction!!! Cheers.
$('#example').dataTable( {
"aoColumnDefs": [
{
"aTargets": [ 0 ],
"bUseRendered": false,
"fnRender": function ( o ) {
return o.oSettings.fnFormatNumber( parseFloat( o.aData[ o.iDataColumn ] ) );
}
}
]
} );
This discussion has been closed.
Replies
Allan