$.fn.dataTable.render.number seems to truncate numbers not round
$.fn.dataTable.render.number seems to truncate numbers not round
chrisbush
Posts: 1Questions: 1Answers: 0
Is there any way to change the behaviour to round a number not truncate ?
The underlying value is 4084.72 but the below rendering is displaying the number as 4084 not 4085 as i would expect.
Im using
{ "mData": "quantity",
"sClass": "text-right",
render: $.fn.dataTable.render.number( ',', '.', 0 )
},
Thanks
Chris
This discussion has been closed.
Answers
What version of DataTables are you using? There was a bug in older versions where it effectively took the integer value only rather than rounding as you describe. 1.10.13, the current release, should not suffer from that issue.
Allan