I am trying to beautify a program by displaying 1.2 if it is 1.2 and 1 if it is 1 problem is I have stored the numbers into the arraylist as doubles. How can I check if a Number
You can use:
double x=4; //To check if it is an integer. return (int)x == x;