Hi,
that’s probably happening because the sorting algorithm from the DataTables JavaScript library (which does the sorting), detects the cell contents as strings and not as plain numbers. And as strings are sorted differently, you get these results.
Can you post the URL to the page with your table? I can then try to find out what’s causing this in your case.
Regards,
Tobias
Hi,
Therefore, is there a way to sort number ?
here’s the URL!
Hi,
thanks for the link.
The reason in your case is that you are using commas (,) in your numbers. I know that this is the common character to use in France (and here in Germany, too), but unfortunately, the DataTables library is developed in Great Britain (see http://www.datatables.net), where a period (.) is used as a decimal delimiter.
Therefore, I suggest that you replace all , with . in your cells. Another idea could be to install this plugin extension: http://tobias.baethge.com/download/plugins/additional/wp-table-reloaded-commavalues.zip
Regards,
Tobias
Thank you for you answer,
OK for using a period instead of a comma.
Regarding the plugin extension (I install it as a usual plugin), it does not change anything if I keep commas.
Regards
Hi,
if using a period works for you, that’s great!
The plugin extension is rather old already, so it might not work anymore. I’ll have to take a deeper look once I find the time. And it might be that it actually had a different purpose (namely allowing commas a thousand separators), I don’t really remember at the moment…
Best wishes,
Tobias
Thank you for taking time to answer Tobias,
regards.
Hi,
no problem, you are very welcome!
Best wishes,
Tobias