Hi, i just created an extension of NumberField that allows you to create number fields with aditional features like:
The text in red are no longer valid.
No longer need functions to update the format.
No more $ by default.
Thousand separator allows any character including blank space (' ').
Improved getFormattedValue function and other code, now is more clean and short.
1. Currency Symbol (by default is $), if you don't need a currency symbol just set the config option to null or empty string:. To change the currency after the field was created you should use the function setCurrencySymbol.Code:currencySymbol: null
No more $ by default, if you need it set up manually by using the config option like before: currencySymbol: $.
2. Thousand separator, you can use comma (,) or (.) any character. If decimalSeparator is (,) then thousand separator will be (.) when thousandSeparator use default value. By default decimalSeparator is (.) and thousand separator (,). Also you cand hide thousand separator using the config option:.Code:useThousandSeparator: false
There are also a functions for setDecimalPrecision and setDecimalSeparator.
3. Display always all the decimals from the given decimal precision value the default value for this config option is:.Code:alwaysDisplayDecimals: false
4. Config option to set any thousandSeparator:
If you are changing the properties after the field is created and don't want or you can't use the functions for any reason you must call updateNumberFormat function.
Here is an screenshot:
The first fielset shows a list of fields configured for int values with the different options
The second fieldset shows a list of fields configured for float values with a decimal precision of 4 and you can notice there are only 3 decimals visibles because only 3 were entered for the values.
The third fielset shows a list of fields configured for float values with a decimal precision of 4 and you can notice there are 4 decimals but last one is zero (0) they have the same values as the second fieldset and also thousand separator is "blank space"
Here is the source code: (Actual version) NumericField.zip
Hope it helps.