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,911
    Answers
    655
    Vote Rating
    443
    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 Premium Member lorezyra's Avatar
    Join Date
    Dec 2007
    Location
    Japan -- 日本
    Posts
    634
    Answers
    8
    Vote Rating
    13
    lorezyra will become famous soon enough 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!
    ================================================
    And here are my terms...
    1. I don't care if you use my source code. (Known as "Code.")
    2. I don't care if I get any monetary compensation.
    3. I do care to receive credit for Code provided. So, please keep my name in the comments for Code provided.
    4. Code is provided without warranty "AS-IS" and I claim absolutely no warranty nor liability to the quality, security, and run-ability on any platform.
    5. By using Code, you accept all risk inherit with Code regardless if Code has known and yet to be discovered bugs.
    6. You are welcome to change and improve the Code to best meet your needs.
    7. I don't care if you use the Code in a commercial or open-source project.
    8. You are not required to contact me prior to using the Code.
    ================================================
    Simple. Enjoy.

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi