It now works for me for user-entered values ββin the number field.
As noted by Lionel, this is necessary:
// set this once after Ext.onReady Ext.util.Format.thousandSeparator = '.'; Ext.util.Format.decimalSeparator = ',';
Then change your handler to this:
blur: function(field) { field.setRawValue(Ext.util.Format.number(field.getValue(), '0.000,00/i')); }
You should also include this configuration in your number field:
decimalSeperator: ','
This will allow users to enter their own decimal characters.
Working example
Here is a working script for this using a number field.
Warning word
Ext.form.field.Number does not support formatting, the blur handler that I gave above will work fully if the user edits this field, and then does not return to it to edit it again if he redirects the field that will check and try to fix thousands of markers in decimal numbers.
If you use this field to send data back to the server, it will send it back in the format that is displayed (with thousands of delimiters), I do not know if this was what you were doing.
If you just need formatted numbers, you should do what you are trying to do above, but using textfield . That way, it wonβt reconfigure your thousands as decimal places.
If you need all the functionality of a number field (spinners, min / max validation, step increments, etc.), you need to take a look at the extension of the numberfield class numberfield here is a user extension that already exists, and this is almost what you need, but it includes a currency symbol, it would be quite easy to do so.