so you need to extend numberfield and decide to accept input with multiple decimalseparator but display only number with dot for decimalSeparator !
Code:
var myNumberField = Ext.Extend(Ext.form.NumberField, {
initEvents : function(){
var allowed = this.baseChars + '';
if (this.allowDecimals) {
allowed += this.decimalSeparator;
allowed += ","; // << add comma
}
if (this.allowNegative) {
allowed += '-';
}
this.maskRe = new RegExp('[' + Ext.escapeRe(allowed) + ']');
Ext.form.NumberField.superclass.initEvents.call(this);
},
getErrors: function (value) {
value = value || this.processValue(this.getRawValue());
value = value.replace(',', '.');
return myNumberField.superclass.getErrors.call(this, value);
},
setValue : function(v){
v = Ext.isNumber(v) ? v : parseFloat(String(v).replace(',', "."));
return myNumberField.superclass.setValue.call(this, v);
},
parseValue : function(value){
value = parseFloat(String(value).replace(",", "."));
return myNumberField.superclass.parseValue.call(this, value);
}
});