From ca818beca59cd69fa790a10ace64d4dfa631ba20 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Tue, 18 Jan 2011 12:08:22 +0100 Subject: [PATCH] Update to latest jquery-global plugin --- external/jquery.global.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/external/jquery.global.js b/external/jquery.global.js index fcaacf9c7..8aac5fdbe 100644 --- a/external/jquery.global.js +++ b/external/jquery.global.js @@ -151,14 +151,18 @@ Globalization.format = function(value, format, culture) { Globalization.parseInt = function(value, radix, culture) { return Math.floor( this.parseFloat( value, radix, culture ) ); } -Globalization.parseCurrency = function(value, culture) { - return this.parseFloat(value.replace(/[^\d,.-]/g, ""), 10, culture); -} Globalization.parseFloat = function(value, radix, culture) { culture = this.findClosestCulture( culture ); var ret = NaN, nf = culture.numberFormat; + if (value.indexOf(culture.numberFormat.currency.symbol) > -1) { + // remove currency symbol + value = value.replace(culture.numberFormat.currency.symbol, ""); + // replace decimal seperator + value = value.replace(culture.numberFormat.currency["."], culture.numberFormat["."]); + } + // trim leading and trailing whitespace value = trim( value ); -- 2.39.5