View Full Version : [CLOSED] Ext.form.NumberField do not handle big integer numbers properly

22 Nov 2010, 10:57 AM

It looks like Ext.form.NumberField field do parse its value on blur event:

beforeBlur : function() {
var v = this.parseValue(this.getRawValue());

if (!Ext.isEmpty(v)) {
Due to JavaScript numbers nature, integers are considered reliable (numbers without a period or exponent notation) to 17 digits. I.e. if you type number 12345678901234567 into the NumberField, then it will parse the value and return 12345678901234568

One of the solutions can be to treat value of NumberField as a string or at least as an array of numbers (for future bit numbers operations support). I'm working on UI fix for this and probably will post it here later.

What do you think about this guys?

23 Nov 2010, 6:15 AM
Ext.form.NumberField uses a javascript Number to hold the value. This type is implemented as an IEEE 754 Double precision floating point which has 15 significant digits.

If you want to support larger numbers, use an Ext.form.TextField that only allows numbers to be entered (so the final value is a String and not a Number).