tablesort
Version:
A sorting component for HTML tables
6 lines • 509 B
JavaScript
/*!
* tablesort v5.7.1 (2026-04-15)
* http://tristen.ca/tablesort/demo/
* Copyright (c) 2026 ; Licensed MIT
*/
(()=>{function a(t){return t.replace(/[^\-?0-9.]/g,"")}Tablesort.extend("number",function(t){return t.match(/^[-+]?[£\x24Û¢´€]?\d+\s*([,\.]\d{0,2})/)||t.match(/^[-+]?\d+\s*([,\.]\d{0,2})?[£\x24Û¢´€]/)||t.match(/^[-+]?(\d)*-?([,\.]){0,1}-?(\d)+([E,e][\-+][\d]+)?%?$/)},function(t,e){return t=a(t),e=a(e),e=e,t=t,e=parseFloat(e),t=parseFloat(t),(e=isNaN(e)?0:e)-(t=isNaN(t)?0:t)})})();