diff options
Diffstat (limited to 'external/jquery.global.js')
-rw-r--r-- | external/jquery.global.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/external/jquery.global.js b/external/jquery.global.js index fcaacf9c7..29ae5c637 100644 --- a/external/jquery.global.js +++ b/external/jquery.global.js @@ -151,14 +151,24 @@ 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) { + // make radix optional + if (typeof radix === "string") { + culture = radix; + radix = 10; + } + 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 ); |