/** * This sorting plug-in allows for HTML tags with numeric data. With the 'html' * type it will strip the HTML and then sorts by strings, with this type it * strips the HTML and then sorts by numbers. Note also that this sorting * plug-in has an equivalent type detection plug-in which can make integration * easier. * @name Numbers with HTML * @anchor numbers_html * @author Allan Jardine */ jQuery.extend( jQuery.fn.dataTableExt.oSort, { "num-html-pre": function ( a ) { var x = a.replace( /<.*?>/g, "" ); return parseFloat( x ); }, "num-html-asc": function ( a, b ) { return ((a < b) ? -1 : ((a > b) ? 1 : 0)); }, "num-html-desc": function ( a, b ) { return ((a < b) ? 1 : ((a > b) ? -1 : 0)); } } );