From: jzaefferer Date: Tue, 18 Jan 2011 11:08:22 +0000 (+0100) Subject: Update to latest jquery-global plugin X-Git-Tag: 1.9m4~38^2~31 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ca818beca59cd69fa790a10ace64d4dfa631ba20;p=jquery-ui.git Update to latest jquery-global plugin --- 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 );