Sort on a Currency Column
Sort on a Currency Column
I am really enjoying customizing DataTables for my project. So much so I donated. However, I am having a real hard time getting a column of currency values to sort. (Note: My column of currency values is NOT prefixed with a dollar sign or euro sign, they are just values with commas and decimals like this:
4,500.00
44,000.00
500,000.00
1,000,000.00
10,000.00 )
If have tried this
[code]{ "sSortDataType": "dom-text", "sType": "numeric"}[/code]
which does not work and I have tried the Formatted Numbers plugin to no avail. This seems like something that would be a very common column in a datagrid which could need sorting. I have looked for examples but have failed to find any. I have tried putting the Formatted Numbers code on my page and also in [code]jquery.dataTables.js[/code] to no avail. I am just not seeing how to get this to work. Help! (Another note, the column is clear of all extraneous HTML so it is a clean column).
4,500.00
44,000.00
500,000.00
1,000,000.00
10,000.00 )
If have tried this
[code]{ "sSortDataType": "dom-text", "sType": "numeric"}[/code]
which does not work and I have tried the Formatted Numbers plugin to no avail. This seems like something that would be a very common column in a datagrid which could need sorting. I have looked for examples but have failed to find any. I have tried putting the Formatted Numbers code on my page and also in [code]jquery.dataTables.js[/code] to no avail. I am just not seeing how to get this to work. Help! (Another note, the column is clear of all extraneous HTML so it is a clean column).
This discussion has been closed.
Replies
Regards,
Allan
Regards,
Allan