Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium Member
    Join Date
    Aug 2008
    Location
    USA
    Posts
    61
    Vote Rating
    1
    Podlipensky is on a distinguished road

      0  

    Default [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:
    Code:
        beforeBlur : function() {
            var v = this.parseValue(this.getRawValue());
            
            if (!Ext.isEmpty(v)) {
                this.setValue(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?
    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

  2. #2
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    92
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    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).

Similar Threads

  1. Replies: 3
    Last Post: 16 Apr 2010, 4:42 AM
  2. Replies: 5
    Last Post: 2 Apr 2009, 12:16 AM
  3. Replies: 4
    Last Post: 16 Feb 2009, 12:26 AM
  4. [1.2.1] NumberField (Integer) allows decimals
    By jonjanisch in forum Ext GWT: Bugs (1.x)
    Replies: 0
    Last Post: 13 Jan 2009, 1:54 PM

Thread Participants: 1

Tags for this Thread