1

Ext.field.Number is allowing . (dot) as a decimal separator. Can we specific other Decimal Separator like "," ?

Explanation: Ext.field.Number field allow to put . (dot) as a decimal separator. so 12.34 is valid number

but on some culture "," (comma) is treated a decimal but 12,34 is not coming as valid number

on onBlur(): Method e.target.value comes as empty string (""). even one cannot set value as 12,34 in number field

So, I thought if we could make "," (comma) as a decimal separator ?

Posto
  • 7,362
  • 7
  • 44
  • 61
  • in Sencha Touch ? Nothing on Documentation http://docs.sencha.com/touch/2.3.1/source/Number3.html#Ext-field-Number. Also tried, but not working – Posto Dec 05 '14 at 10:22
  • 1
    Your question is not clear. You should write some sample/real code to make reader under what exactly you need. – Anand Gupta Dec 05 '14 at 11:04
  • 1
    @AnandGupta added Explanation. – Posto Dec 05 '14 at 13:08

1 Answers1

0

Unfortunately, there is no way out of the box to handle this. The major difference between Ext.field.Text and Ext.field.Number (in Sencha Touch) is that Ext.field.Number actually uses the HTML input element with a type of number. This does not allow for using commas instead of periods for decimals.

Your best course of action here is to use Ext.field.Text and add some additional handling, depending on why exactly you need to use Ext.field.Number. As you can see by the source file here there isn't much that Ext.field.Number does that you cannot implement yourself.

OhmzTech
  • 897
  • 1
  • 5
  • 7