You found a bug! We've classified it as EXTJS-12080 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Nov 2013
    Location
    India
    Posts
    2
    Vote Rating
    0
    shankarram is on a distinguished road

      0  

    Default Ext.util.Format.number returns Nan.undefined when NaN is provided as input

    Ext.util.Format.number returns Nan.undefined when NaN is provided as input


    Stand-Alone TestcaseExt version tested:
    • Ext 4.2.1
    • Ext 4.2.2
    Browser versions tested against:
    • IE9
    • IE8
    • FF26 (firebug 1.12.16 installed)
    • Chrome 31
    Description:
    • Ext.util.Format.number returns Nan.undefined when NaN is provided as input
    Steps to reproduce the problem:
    • Ext.util.Format.number(NaN, '0,000.00')
    The result that was expected:
    • ''
    The result that occurs instead:
    • Nan.undefined
    The following code has been removed from the number function of Ext 4.2.1 version and I couldn't find this removal of feature in the document:

    Code:
    v = Ext.Number.from(v, NaN);
    if (isNaN(v)) {
        return '';
    }

  2. #2
    Sencha - Support Team
    Join Date
    Feb 2013
    Location
    California
    Posts
    5,446
    Vote Rating
    112
    Gary Schlosberg is just really nice Gary Schlosberg is just really nice Gary Schlosberg is just really nice Gary Schlosberg is just really nice Gary Schlosberg is just really nice

      0  

    Default


    Thanks for the report! I have opened a bug in our bug tracker.

  3. #3
    Sencha Premium Member Dejan Beciric's Avatar
    Join Date
    Feb 2014
    Location
    Belgrade, Serbia
    Posts
    45
    Vote Rating
    8
    Dejan Beciric will become famous soon enough

      0  

    Default


    Also, the same is when we pass a big number, for example:

    Ext.util.Format.number(1e+40, '0,000.00') - the result is 1e,+40.undefined

    Note:
    for Ext.util.Format.number(1e+10, '0,000.00') result is ok and as expected.