Game Development Community

RC3: Large numbers display

by Jason McIntosh · in Torque Game Builder · 06/17/2006 (8:57 am) · 3 replies

Using large numbers (like 1,000,000+) will be converted into scientific notation, thus rendering any kind of score display impossible unless they're under this threshold. I looked for a formatting string that would fix this, but didn't come up with anything. I believe it's somewhere in the math functions.

To reproduce:
echo( 500000 + 500000 );
echo( 500000 + 100 );
Observe the difference. :)

#1
06/17/2006 (9:33 am)
You could make a function that converts an integer in scientific notation to a string in full length.
This isnt a bug, thats just as high as it goes!
#2
06/17/2006 (10:36 am)
True, but why should that be necessary for a game engine which will more than likely use numbers to represent scores and not scientific data? I call it a bug. :)
#3
06/17/2006 (2:20 pm)
This is somewhat resolvable (according to Luke D, I haven't tried it yet) if you search/replace %g with %.7g in several of the console .cc files, as noted in this thread.