diff --git a/sorting/formatted-numbers.js b/sorting/formatted-numbers.js index c1b9d45..71307b0 100644 --- a/sorting/formatted-numbers.js +++ b/sorting/formatted-numbers.js @@ -8,16 +8,16 @@ */ jQuery.extend( jQuery.fn.dataTableExt.oSort, { - "formatted_numbers-pre": function ( a ) { + "formatted-num-pre": function ( a ) { a = (a==="-") ? 0 : a.replace( /[^\d\-\.]/g, "" ); return parseFloat( a ); }, - "formatted_numbers-asc": function ( a, b ) { + "formatted-num-asc": function ( a, b ) { return a - b; }, - "formatted_numbers-desc": function ( a, b ) { + "formatted-num-desc": function ( a, b ) { return b - a; } } ); diff --git a/type-detection/formatted-num.js b/type-detection/formatted-num.js index 1266efc..4148127 100644 --- a/type-detection/formatted-num.js +++ b/type-detection/formatted-num.js @@ -14,7 +14,7 @@ jQuery.fn.dataTableExt.aTypes.unshift( function ( sData ) { var deformatted = sData.replace(/[^\d\-\.\/a-zA-Z]/g,''); - if ( $.isNumeric( deformatted ) ) { + if ( $.isNumeric( deformatted ) || deformatted === "-" ) { return 'formatted-num'; } return null;