From 0f48828c8fc5ab03990edd819fa3623e43925d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Tue, 11 Jan 2011 10:43:47 +0000 Subject: [PATCH] Bugfix Sortieren von Zahlen mit Tausenderpunkt --- include/js/jquery.tablesorter.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/include/js/jquery.tablesorter.js b/include/js/jquery.tablesorter.js index 3b24b7647..090309456 100644 --- a/include/js/jquery.tablesorter.js +++ b/include/js/jquery.tablesorter.js @@ -728,6 +728,17 @@ type: "numeric" }); + ts.addParser({ + id: "digitmittausenderpunkt", + is: function(s) { + return /^[0-9.,]/.test(s); + }, + format: function(s) { + return $.tablesorter.formatFloat(s.replace('.',"")); + }, + type: "numeric" + }); + ts.addParser({ id: "integer", is: function(s,table) { @@ -743,10 +754,10 @@ ts.addParser({ id: "currency", is: function(s) { - return /^[£$€?.,]/.test(s); + return /^[£$€?.]/.test(s); }, format: function(s) { - return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.,]/g),"")); + return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),"")); }, type: "numeric" });