$.fn.dataTable.render.number seems to truncate numbers not round

$.fn.dataTable.render.number seems to truncate numbers not round

chrisbushchrisbush Posts: 1Questions: 1Answers: 0
edited March 2017 in Free community support

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

Answers

  • allanallan Posts: 61,934Questions: 1Answers: 10,155 Site admin

    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

This discussion has been closed.