Update to latest jquery-global plugin

This commit is contained in:
jzaefferer 2011-01-18 12:08:22 +01:00
parent 67b070f97a
commit ca818beca5

View 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 );