How to render number
How to render number
irwanto
Posts: 2Questions: 1Answers: 0
i want to render column but if data is zero (0), it's display 0,00
how can i render column if data is zero still display 0 . not 0,00. if data is 123,56 display 123,56
columns: [
{
data: 'tahun'
},
{
data: 'januari',
render: $.fn.dataTable.render.number('.', ',', 2, '')
}
]
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
This discussion has been closed.
Replies
You can use the
$.fn.dataTable.render.number('.', ',', 2, '')
in a render function. See Allan's last comment in this thread. You can use an if statement to determine whether to return 0 or to return$.fn.dataTable.render.number('.', ',', 2, '').display( data )
.Kevin