* @cfg {String} decimalSeparator Character(s) to allow as the decimal separator (defaults to '.')
*/
decimalSeparator : ".",
+ /**
+ * @cfg {String} thousandSeparator Character(s) to allow as the thousand separator (defaults to '') - set to ',' for example
+ */
+ thousandSeparator : "",
/**
* @cfg {Number} decimalPrecision The maximum precision to display after the decimal separator (defaults to 2)
*/
// private
parseValue : function(value){
- value = parseFloat(String(value).replace(this.decimalSeparator, "."));
+ value = parseFloat(String(value).replace(this.decimalSeparator, ".").replace(this.thousandSeparator, ''));
return isNaN(value) ? '' : value;
},
setValue : function(v){
v = this.fixPrecision(v);
+ if(this.thousandSeparator != ''){
+ v = Roo.util.Format.number(v, this.decimalPrecision, this.thousandSeparator);
+ }
Roo.form.NumberField.superclass.setValue.call(this, String(v).replace(".", this.decimalSeparator));
},