I want to render a number on my data amount in column
I want to render a number on my data amount in column

this is my code
{data:'amount',
render: function(data, type,row){
if(row.trans_type=='Penalty'){
return ''+row.credit+'';
} else{
return ''+row.debit+'';
}
}, render : $.fn.dataTable.render.number(',','.',2)
},
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
i dont have a amount column in database, but i have debit and credit column and in column header amount i want to show if the data is credit it will show the credit data and debit it will show debit data and the render function is not working because there are no parameter amount on database
This example is doing what you're after,
Colin