mirror of
https://github.com/dawidolko/Website-Templates.git
synced 2026-03-23 01:42:19 +00:00
Website templates
This commit is contained in:
29
startbootstrap-sb-admin-2-1.0.5/bower_components/datatables-plugins/sorting/scientific.js
vendored
Normal file
29
startbootstrap-sb-admin-2-1.0.5/bower_components/datatables-plugins/sorting/scientific.js
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* This plug-in will treat numbers which are in scientific notation (for
|
||||
* example `1E-10`, `1.2E6` etc) and sort them numerically.
|
||||
*
|
||||
* @name Scientific notation sorting
|
||||
* @summary Sort data which is written in exponential notation.
|
||||
* @author [Nick Schurch](http://datatables.net/forums/profile/21757/nickschurch)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'scientific', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"scientific-pre": function ( a ) {
|
||||
return parseFloat(a);
|
||||
},
|
||||
|
||||
"scientific-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"scientific-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
||||
Reference in New Issue
Block a user