Skip to content
Permalink
Browse files

Update to latest jquery-global plugin

  • Loading branch information
jzaefferer committed Jan 18, 2011
1 parent 67b070f commit ca818beca59cd69fa790a10ace64d4dfa631ba20
Showing with 7 additions and 3 deletions.
  1. +7 −3 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 );

0 comments on commit ca818be

Please sign in to comment.
You can’t perform that action at this time.