I have a calculator application.
How do I achieve the following?
If there are non-zero numbers after the decimal, then it should stay as double.
If there is NO non-zero number after the decimal, it should be converted to the integer equivalent of double.
For Example, 10.0003 should be displayed as 10.0003. Where as 10.0 should be displayed as 10.
Currently I display all the results as Double (10.0). How can I check if there are any non-zero numbers after the decimal? Do we have a simple solution?