]> source.dussan.org Git - jquery-ui.git/commitdiff
Update to latest jquery-global plugin
authorjzaefferer <joern.zaefferer@gmail.com>
Tue, 18 Jan 2011 11:08:22 +0000 (12:08 +0100)
committerjzaefferer <joern.zaefferer@gmail.com>
Tue, 18 Jan 2011 11:08:22 +0000 (12:08 +0100)
external/jquery.global.js

index fcaacf9c756317fd4d89f81070277b93bab044f0..8aac5fdbef355963c668d3c9a7af4326f20ece32 100644 (file)
@@ -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 );