I want to display a big number on a text label, however it gets displayed in scientific notation. I’ve tried using string format but it just gives me a lot of zeroes at the end. like 42343565.0000000 something like that.
So when using string.format the “%f” part is the format to follow. So for you the float probably has a small decimal number on the end of it e.g. 42343565.00000000001. To fix this you can use different formatting types:
c = Integer
d or i = Integer with Decimal Representation e.g. 3.24 = 324
e or E = Scientific Float Notation
f = float
The %f format have a precision of 6 decimal places by default, you can use %.0f so it’ll format it with no fractional digits (rounded).
Floats (double precision in this case) will always represent an integer without any fractional value exactly if it’s under 2 ** 53 (9007199254740992) (for double precision).
There would be no reason to have few trailing zeroes when formatted if it has a very small fractional number than if it doesn’t.
%c will format to an ASCII character, not as a base 10 integer.