Created
October 28, 2014 13:09
-
-
Save melihucar/0d54a3076a74f2c7fd65 to your computer and use it in GitHub Desktop.
Datatable currency sort
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.extend( jQuery.fn.dataTableExt.oSort, { | |
| "currency-pre": function ( 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; | |
| } | |
| } ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment