Need help sorting numbers with comman and dot like 1,512,542.85 / 985,124.05 / 7,542.12
Need help sorting numbers with comman and dot like 1,512,542.85 / 985,124.05 / 7,542.12
Need help sorting numbers with comman and dot like 1,512,542.85 / 985,124.05 / 7,542.12
How could i do this? I already check this
http://datatables.net/release-datatables/examples/plug-ins/sorting_plugin.html
but i can't make it works
How could i do this? I already check this
http://datatables.net/release-datatables/examples/plug-ins/sorting_plugin.html
but i can't make it works
This discussion has been closed.
Replies
http://datatables.net/forums/discussion/472/sorting-money-brasil#Item_9 and i could make my own js
jQuery.fn.dataTableExt.oSort['honduran-desc'] = function(a,b) {
var x = (a == "-") ? 0 : a.replace( /,/g, "" ).replace( /\./, ".");
var y = (b == "-") ? 0 : b.replace( /,/g, "" ).replace( /\./, ".");
x = parseFloat( x );
y = parseFloat( y );
return ((x < y) ? 1 : ((x > y) ? -1 : 0));
};