I am making a calculator. It has two "screens", one showing input and one showing output. When the equals button is pressed on the calculator, the calculation is shown on the output screen.
I have come across this problem:
Let's say I type into the input screen "10" and then press equals, the output screen will show "10". Good, this is working correctly. It works correctly if I do the same but with "100", "1000", "10000" and "100000".
However, when I try it with "1000000" I get the following result:
If I add any more numbers I get the same value but the 6 increases.
How do I change this so that it shows the raw number instead of this format?
For example, instead of showing "1e+006", I want it to show "1000000".
Some more information:
The reason the input works is because every time a button is pressed it adds it to the screen's string and then displays it. However, this method isn't practical for the output screen, so how can I do this another way?
Thanks in advance for any help that any of you provide.