From 1c371e18b4eff412054448378ab837287b5b0449 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 6 Oct 2014 20:17:46 +0200 Subject: [PATCH] Bug 12987: Fix remove all what is not number The regex was wrong, to calculate a total, we should keep number (0-9) and minus sign (-). All others characters should be removed. --- koha-tmpl/intranet-tmpl/prog/en/js/datatables.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js index 838f27e..92abf10 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js @@ -616,7 +616,7 @@ function footer_column_sum( api, column_numbers ) { if ( isNaN(i) ) return 0; return i; } else if ( typeof i === 'string' ) { - var value = i.replace(/[a-zA-Z ,.]/g, '')*1; + var value = i.replace(/[^-0-9]/g, '')*1; if ( isNaN(value) ) return 0; return value; } -- 2.1.0