I tried to build a simple calculator. When there is a value with decimal point after 7 or over 7 digits, the result of the calculation is displayed unnormal. But this doesn't occur for 6 digits or less with decimal value.
For example: 1234567.03 x 2, the result is 2.4691E6, but not 2469134.06 ; how can I fix it ?
Hi, thank you for your answer and it’s very helpful to me. But there is another error, when there is a value with decimal point after 7 or over 7 digits, the result of the calculation is displayed abnormal, the last 2 digits and the 2 decimal digits would become “0”, whatever the equation is plus/minus/multiplied/divided. But this doesn't occur for 6 digits or less with decimal value, or the value is more than 7 digits but no decimal places, the result of the calculation is also correct.
For example: 123456789 +2 = 123456791 ; it’s ok, no error;
123456.78 + 2 = 123458.78 ; it’s ok, no error.
But when : 1234567.89 + 2, the result is 1234600.00, but not 1234569.89 ;
Or when : 1234567.89 x 2, the result is 2469100.00, but not 2469135.78
Is this calculator intended for financial calculations, where each amount is in dollars and cents and indefinitely large numbers are expected and cents must be accounted for?
In such situations financial apps store their values in cents as integers, and only divide by 100 for display purposes.