PDA

View Full Version : numberfield thousand and decimal seperator get confused



hasimseo
13 Nov 2013, 2:03 AM
Ext version tested:
4.2.1

hi

in numberfield when we change thousandseperator as dot (.) and change decimalseperator to comma(,) it get confused and give us a wrong number.
Acctually it get the first dot seperator ,which is thousand seperator as decimal seperator and cropt the next 2 digit as decimal after you click into field and escape.


{
hideTrigger: true,
xtype:'numberfield',
fieldLabel: 'Cost',
name: 'cost',
decimalSeperator:',',
useThousandSeparator: true,
listeners: {
blur: function(field) {
field.setRawValue(Ext.util.Format.number(field.getValue(), '0.000,00/i'));
}
}
}

468154681646817

evant
13 Nov 2013, 2:35 AM
There is no "useThousandSeparator" option for field.Number.

Also, the /i format depends on Ext.util.Format.decimalSeparator/thousandSeparator being set. Have you done that?

hasimseo
13 Nov 2013, 3:36 AM
thanks for reply
i had done this and of course i tested it code editor at this link
( http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.form.field.Number ) and same problem at this http://jsfiddle.net/Geronimo/ferXz/ too


Ext.util.Format.decimalSeparator = ',';
Ext.util.Format.thousandSeparator = '.';

evant
13 Nov 2013, 4:02 AM
That doesn't show up in your example.

When I type "23452345" and then blur, the field shows "23.452.345,00".

hasimseo
13 Nov 2013, 4:58 AM
"23.452.345,00" after you see this click inside and than click out as i mentioned in the pics. you will see the real problem.
in the end it will shown as 23,45 or 23,00