How to remove the decimal part from a float number that contains .0 in java
<p>I just want to remove the fractional part of a float number that contains <strong>.0</strong>. All other numbers are acceptable..
For example :   </p>

<pre><code>  I/P: 1.0, 2.2, 88.0, 3.56666, 4.1, 45.00 , 99.560
  O/P: 1 ,  2.2, 88,   3.567,   4.1, 45 ,    99.560
</code></pre>

<p>Is there any method available to do that <strong>other than</strong> "<em>comparing number with ".0" and taking substring</em>" ?</p>

<p>EDIT :
 I don't want ACTING FLOAT NUMBERs (like 1.0, 2.0 is nothing but 1 2 right?)</p>

<p>I feel my question is a little confusing...<br>
Here is my clarification: I just want to display a series of floating point numbers to the user. If the fractional part of a number is zero, then display only the integer part, otherwise display the number as it is. I hope it's clear now..</p>
