Large Numbers - don't store correctly in tables!

DigiChainDigiChain Member, PRO Posts: 1,288
edited November 2016 in Working with GS (Mac)

I'm trying to input some large numbers into a table but some of them don't store correctly.
So for example I want to input the number 3,902,660,000 into a table cell.

If I enter it as an integer it changes it to: -392307296
If I enter it as a Real attribute it changes it to: 3,902,660,096

I can enter it as a text attribute fine but am unsure if I can then use mathematical functions with them in the same way as I would integers or real attributes.

Does anyone know whats going on?

Comments

  • MantoManto Member Posts: 796

    Just tested this with GS v.1.25.73. The integer does change to -392307296, but for the Real remained as 3,902,660,000. If I use Text attribute in the table, for example adding 1 to the number works just as expected.

  • DigiChainDigiChain Member, PRO Posts: 1,288

    Thanks Manto, I'm running v.1.25.73 too (mac version) so odd that real doesn't work for me - it's only the last couple of digits that are changing when using real.

    I'll have to store them as a text attribute and hope I don't run into issues down the line then!

  • MantoManto Member Posts: 796
    edited November 2016

    @DigiChain said:
    Thanks Manto, I'm running v.1.25.73 too (mac version) so odd that real doesn't work for me - it's only the last couple of digits that are changing when using real.

    I'll have to store them as a text attribute and hope I don't run into issues down the line then!

    Strange. What value did you use in the change table value? I only tested it by inserting 3902660000 as an expression and using a real attribute. Then tested it with each table column type (Integer, Real, Text).

  • HopscotchHopscotch Member, PRO Posts: 2,782
    edited November 2016

    @DigiChain

    For integers, 2147483647 is the largest number it can hold, in most languages.

    Also, with real number you will start running into the problem that after 14 digits, the number will be represented in scientific notation, making the Display Text useless.

    It is best to use text, as you can still do calculations on it if the text attribute contains a whole number.

  • DigiChainDigiChain Member, PRO Posts: 1,288

    Ok, thanks for the help guys!

  • SocksSocks London, UK.Member Posts: 12,822

    @DigiChain said:
    Ok, thanks for the help guys!

    Divide by 1,000 > save to table.

    For use, recall from table then multiply by 1,000.

  • SocksSocks London, UK.Member Posts: 12,822
    edited November 2016

    Seems to work fine on 1.25.54.

    I tried this:

    When touch is pressed change table value to 3902660000

    Display table value shows me 3902660000

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    @Socks said:

    @DigiChain said:
    Ok, thanks for the help guys!

    Divide by 1,000 > save to table.

    For use, recall from table then multiply by 1,000.

    ...SORCERY!

Sign In or Register to comment.