Adding A $ sign to column numbers
Adding A $ sign to column numbers
dobulet302
Posts: 38Questions: 0Answers: 0
I am currently using the following code to add a comma to the targeted columns
[code]
"aoColumnDefs": [
{
"aTargets": [2,3,4,5 ],
"bUseRendered": false,
"fnRender": function ( o ) {
return o.oSettings.fnFormatNumber( parseFloat( o.aData[ o.iDataColumn ] ) );
}
}
]
[/code]
how can I add a dollar sign to column 1?
[code]
"aoColumnDefs": [
{
"aTargets": [2,3,4,5 ],
"bUseRendered": false,
"fnRender": function ( o ) {
return o.oSettings.fnFormatNumber( parseFloat( o.aData[ o.iDataColumn ] ) );
}
}
]
[/code]
how can I add a dollar sign to column 1?
This discussion has been closed.
Replies
[code]
"aoColumnDefs": [
{
"aTargets": [1],
"fnRender": function ( o ) {
return "$"+o.aData[ o.iDataColumn ];
}
},
{
"aTargets": [2,3,4,5 ],
"bUseRendered": false,
"fnRender": function ( o ) {
return o.oSettings.fnFormatNumber( parseFloat( o.aData[ o.iDataColumn ] ) );
}
}
]
[/code]
Allan
[code]
"aoColumnDefs":
[
{
"aTargets": [5],
"bUseRendered":false,
"fnRender": function(o) {
return ''
+ '$'
+ ''
+ o.aData[o.iDataColumn]
+ "";
}
}
]
[/code]