You can convert a String to float using valueOf() and floatValue() methods of Float wrapper class as follows.

    float f = Float.valueOf(str).floatValue();