Converting string to float
843789Aug 23 2010 — edited Aug 25 2010I have a decimal string "122339994" which i am trying to convert to float using Float.parseFloat. This results in incorrect value of 1.22339992E8.
I thought for floats precsision comes into effect after decimal places.
public static void main(String[] args) {
String floatString = "122339994";
float floatNumber = Float.parseFloat(floatString);
System.out.println("Float is "+floatNumber+". Now double "+Double.valueOf(floatString));
}