Commas and $ in datatable columns
Commas and $ in datatable columns
Hi,
I have a datatable with 4 columns that hold currency. Currently I'm treating them as normal columns and manually appending '$' to each value. Now I need to format the column to have commas as well. Is there any plug-in to do this? I also want to remove the manual addition of '$' value. I checked few sites, but I really didn't understand how they work. Thanks a lot for help.
-Maddy
I have a datatable with 4 columns that hold currency. Currently I'm treating them as normal columns and manually appending '$' to each value. Now I need to format the column to have commas as well. Is there any plug-in to do this? I also want to remove the manual addition of '$' value. I checked few sites, but I really didn't understand how they work. Thanks a lot for help.
-Maddy
This discussion has been closed.
Replies
It sounds like this plug-in might be the best option for you: http://datatables.net/plug-ins/sorting#formatted_numbers . It simply strips non-numeric data from the source and then sorts what remains numerically.
Allan
http://josscrowcroft.github.com/accounting.js/
Hope this might help you
setlocale(LC_MONETARY, 'en_US.UTF-8'); at the beginning of the php.
money_format('%(#10n', $cost)
Allan