Render Decimal and Badge
Render Decimal and Badge
wuwu
Posts: 52Questions: 17Answers: 0
Hi, I have tried to render 2 decimal places and comma on Quantity field using below:
"columnDefs": [
{
"targets": [7],
"className": "text-right",
"render": $.fn.dataTable.render.number(',', '.', 2)
}
]
Is it possible if I will also render boostrap badge at the same time? How can I achieve that?
Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
See if this thread regarding badges helps. If not please post a simple test case with an example of your data so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Hi Kevin, I have actually successfully display badge in my qty field but i need also to render comma and decimal places. I added alignment on right but the decimal places does not work. thanks
http://live.datatables.net/tetazoxa/1/edit
You can use the built-in number renderer for that, see here.
Colin
Thanks colin!