Large Numbers - don't store correctly in tables!
DigiChain
Member, PRO Posts: 1,288
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
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.
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).
@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.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Ok, thanks for the help guys!
Divide by 1,000 > save to table.
For use, recall from table then multiply by 1,000.
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
...SORCERY!
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx