/** * Sort numeric data which has a percent sign with it. * @name Percentage * @anchor percentage * @author Jonathan Romley */ jQuery.extend( jQuery.fn.dataTableExt.oSort, { "percent-pre": function ( a ) { var x = (a == "-") ? 0 : a.replace( /%/, "" ); return parseFloat( x ); }, "percent-asc": function ( a, b ) { return ((a < b) ? -1 : ((a > b) ? 1 : 0)); }, "percent-desc": function ( a, b ) { return ((a < b) ? 1 : ((a > b) ? -1 : 0)); } } );