PDA

View Full Version : Numberfield Problems with decimalSeparator



icebergdelphi
22 Apr 2014, 11:52 AM
Hi everybody, i'm trying to write decimals number like this: 0.96 or 1.00, etc,( 2 decimals), but numberfield does not let me write a decimal with a dot character, but the numberfield let me writes comma instead dot character,
Example i need: 1.90

numberfield let me always: 1,90
this is my code:


xtype: 'numberfield',
defaultType: 'numberfield',
width: 210,
fieldLabel: 'Tax',
labelWidth: 120,
name: 'tax',
hideTrigger: true,
decimalPresicion:2,
allowDecimals:true,
decimalSeparator:'.'


I was testing the examples but all seems clear, do i missing something special?
Thanks. :-?

Extjs: 4.2.1
SenchaArchitect :3,

3.0.3.1382

Zinnia
22 Apr 2014, 10:05 PM
Add the below config option in your code, hope this may help you.

minValue : 0.01,
maxValue: 10,
step:0.01

Thanks
Zinnia

icebergdelphi
23 Apr 2014, 5:35 AM
Thanks for your answer but the config is not the problem, i mean, i need to be able write a point instead comma inside the field number:
example:
.0,96 -----------> 0.96

:-?

Gary Schlosberg
23 Apr 2014, 7:32 AM
The decimalSeparator defaults to a dot (.), so perhaps you are using localization or are otherwise overriding the character? I modified the numberfield example in this Fiddle and it works without decimalSeparator being set:
https://fiddle.sencha.com/#fiddle/59o

icebergdelphi
23 Apr 2014, 7:45 AM
The decimalSeparator defaults to a dot (.), so perhaps you are using localization or are otherwise overriding the character? I modified the numberfield example in this Fiddle and it works without decimalSeparator being set:
https://fiddle.sencha.com/#fiddle/59o

Thank you very much Gary, you were right, the problem was the localization, I'm using: ext-lang-es.js what stupid thing, I did not realize about that. Thanks.:D