How can we sort currency column in datatable

How can we sort currency column in datatable

prathnaprathna Posts: 1Questions: 1Answers: 0

We have already add this code but not work:
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"currency-pre": function ( a ) {
a = (a==="-" || a === "") ? 0 : a.replace( /[^\d-.]/g, "" );
return parseFloat( a );
},

        "currency-asc": function ( a, b ) {
            return a - b;
        },

        "currency-desc": function ( a, b ) {
            return b - a;
        }
    } );
-$971.27

Answers

Sign In or Register to comment.