Forbidding Scientific Notation

Hello People of Codea!
I am working on my latest project, a graphical/scientific/basic calculator. I have the problem where if I get any large number it goes into scientific notation. This is a problem for me. I have tried string.format("%.0f") but that removes any decimal values too. So I ask, How can I stop scientific notation from happening? I need decimal values but I will not know how many to have, and I want integers to not have any decimal point. Can anyone help me?
Thanks,
Jordan

http://stackoverflow.com/questions/1133639/how-can-i-print-a-huge-number-in-lua-without-using-scientific-notation

@Ignatz, I already saw that discussion. I need floating points too, and that method does not work

I suspect the answer is that as soon as the number exceeds floating point limits, you will get weird results and won’t be able to print it accurately.

What you may need is a large integer calculation library, where everything is done with strings of integers, and you put the decimals back in at the end. Then you can do any size of calculation.

Yep, @Ignatz, I was wondering if anyone had a number-string parsing snippet of code which spat out the magically formatted number :slight_smile:

If nobody else has any better ideas, you could probably fake it, by splitting the number into integer and fractional parts, then printing them separately with a dot between them.