There are two problems with v02 of the plugin:
- values larger than 999999 don't work. When editing or during getValues() only ONE thousands separator is removed. Result: 1.000.500,50 € => 1000.500.50 which is obviously not a valid floating point value.
- setValues() does not work using JSON floating point values. If 1000.5 is stored in the database the plugin formats the value to 10005,00 - ignoring the "."
rawAmount = String(rawAmount).replace(this.currencyConfig.thousandsSeparator,'');
with this one
var replacer = RegExp(this.currencyConfig.thousandsSeparator,'g');
rawAmount = String(rawAmount).replace(replacer,'');
'g' is for global search and replace
use the same way for cleanForEdit as well
Thanks for your help, but you have to escape the thousandsSeparator to get a valid regexp:
var replacer = new RegExp('\\'+this.currencyConfig.thousandsSeparator,'g');
Hi, I've tried your methods, but 'replacers' didn't help neither of firdefex nor MarkusL. In Edit mode number stays with one comma (thousandsSeparator).
What I find even worse - that I cannot get this value without format-signs - for example, I want to get it's value and make some arithmetic and write result down in other field: neither getForm.findfield("demo") nor getCmp("id_demo") nor smth. else helps.
Only if I send whole form, I can see in getForm().getValues(true) it's right Number value - without currency format.
Maybe somebody knows, whether it's possible to get some kind key/values or some kind of getField from getForm().getValues(true) or you know other solution ? Thank you !
It appear that submitted value of currency field is 'undefined' if no value is entered (field is blank).
We changed line 79 of currency plugin to:
That fixed the problem.Code:return;
This is an absolutely amazing plugin. Works perfect. Thanks so much, saved me a lot of time and made our excel users so happy
Great plugin. Can you create a Sencha Touch 2 version as well?
What about an Ext 4.x version ??