1. #1
    Sencha Premium Member
    Join Date
    Jan 2012
    Posts
    96
    Answers
    1
    Vote Rating
    3
    jeremym is on a distinguished road

      0  

    Default Answered: Large numbers rounded off?

    Answered: Large numbers rounded off?


    I'm not sure if this is an Ext thing or a javascript thing, but I have a store that contains a multi-tiered object and one of the values in it is a large number (for example: 7737164832469684451 ... I've confirmed that this is the value in the json that comes back from the server... however when I try to access this value in the store, it instead comes back as 7737164832469684000 ... I checked with some other similarly large numbers and they all rounded off as well. I'm assuming I'll need to ask the server to return the value as a string... will this happen to all numbers larger than 2^32 ? Is this an ext limitation or a javascript limitation?

  2. If you enter the number in the console, you will get the new result.

    Code:
    > num = 7737164832469684451
    7737164832469684000
    Regards,
    Scott.

  3. #2
    Sencha Premium Member
    Join Date
    Jan 2012
    Posts
    96
    Answers
    1
    Vote Rating
    3
    jeremym is on a distinguished road

      0  

    Default


    Doh! marked my response as the answer rather than yours... not sure how to fix that (tried deleting the post... that didn't do it...) ...

    Looks like its a javascript limitation, thanks!

  4. #3
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,653
    Answers
    618
    Vote Rating
    402
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    If you enter the number in the console, you will get the new result.

    Code:
    > num = 7737164832469684451
    7737164832469684000
    Regards,
    Scott.

  5. #4
    Sencha User lorezyra's Avatar
    Join Date
    Dec 2007
    Location
    Japan -- 日本
    Posts
    531
    Answers
    6
    Vote Rating
    3
    lorezyra will become famous soon enough

      0  

    Default Javascript limitation

    Javascript limitation


    This is a limit of JavaScript itself... Check out this library if you need to handle large numbers...

    https://github.com/silentmatt/javascript-biginteger
    Perfection as a goal is a nice idea that can point one in a specific direction. However, since "perfection" is an ever changing (evolving?) and moving target, one must admit that perfection can never be obtained...

    When in doubt, check the d4mn source code!

Thread Participants: 2

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar