`

Jquery sort table number

 
阅读更多
So here is what the column is sorted as:

    4,666
    141,666
    293
    341,666
    346
    461,676

This should be sorted as

    293
    346
    4,666
    141,666
    341,666
    461,676



$(document).ready(function() {
      $.tablesorter.addParser({
        id: 'fancyNumber',
        is:function(s){return false;},
        format: function(s) {return s.replace(/[\,\.]/g,'');},
        type: 'numeric'
    });
    $("table").tablesorter({headers: {0: {sorter: 'fancyNumber'}}});
});
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics