Last active
December 14, 2015 19:48
-
-
Save csessig86/5138901 to your computer and use it in GitHub Desktop.
DataSet > DataTables part 1
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
// DataTables currency | |
// Use to sort the table via currency | |
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