Tuesday, May 8, 2012

How to remove the decimal part from float number contains .0 in java

i just want to remove the fraction part of float number that contains .0 all other number are acceptable..
For example :



  I/P: 1.0, 2.2, 88.0, 3.56666, 4.1, 45.00
O/P: 1 , 2.2, 88, 3.567, 4.1, 45


Is there any method available to do that other than "comparing number with ".0" and taking substring" ?





No comments:

Post a Comment