the code:
Float f = Float.parseFloat(\"1.80\");
System.out.println(f);
prints \"1.8\"
on screen.
I need to keep the 0 in the float
float
or double
.BigDecimal
or DecimalFormat
, where you can control the number of decimal places.In short the question doesn't really make sense as posed.