-
22 Nov 2010 10:57 AM #1
[CLOSED] Ext.form.NumberField do not handle big integer numbers properly
[CLOSED] Ext.form.NumberField do not handle big integer numbers properly
Guys,
It looks like Ext.form.NumberField field do parse its value on blur event:
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 12345678901234568Code:beforeBlur : function() { var v = this.parseValue(this.getRawValue()); if (!Ext.isEmpty(v)) { this.setValue(v); } }
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?My recent commitment into Sencha community:
Star Rating Field: https://github.com/podlipensky/Ext.ux.touch.Rating
Sencha Articles on my blog: http://podlipensky.com
-
23 Nov 2010 6:15 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
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).
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[CLOSED]Ext.form.SliderField doesn't handle Ext.form.BasicForm.loadRecord
By colin.jones in forum Ext 3.x: BugsReplies: 3Last Post: 16 Apr 2010, 4:42 AM -
[FIXED] [1.2.3] NumberField<Integer> error - the type is not NumberField generic
By The_Jackal in forum Ext GWT: Bugs (1.x)Replies: 5Last Post: 2 Apr 2009, 12:16 AM -
[CLOSED][2.2] Truncation of "0.0" not consistent with other numbers in NumberField.
By AlexKorn in forum Ext 2.x: BugsReplies: 4Last Post: 16 Feb 2009, 12:26 AM -
[1.2.1] NumberField (Integer) allows decimals
By jonjanisch in forum Ext GWT: Bugs (1.x)Replies: 0Last Post: 13 Jan 2009, 1:54 PM


Reply With Quote