From b15b1b42f3dc20d904210ecd672593e642590a23 Mon Sep 17 00:00:00 2001 From: Saverio Date: Wed, 8 Mar 2017 10:21:02 +0100 Subject: [PATCH] insert italy style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit comma for separator decimal dot for thousands separator ES: 1.005,45€ --- sorting/currency.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sorting/currency.js b/sorting/currency.js index b99a6771..18b5cc65 100644 --- a/sorting/currency.js +++ b/sorting/currency.js @@ -22,7 +22,9 @@ jQuery.extend( jQuery.fn.dataTableExt.oSort, { "currency-pre": function ( a ) { - a = (a==="-") ? 0 : a.replace( /[^\d\-\.]/g, "" ); + var foo = a.replace( /[^\d\-\.]/g, "." ); + foo = foo.replace( /[^\d\-\,]/g, "" ); + a = (a==="-") ? 0 : foo; return parseFloat( a ); },