Here you can find the source of toFloat(String s)
public static Float toFloat(String s)
//package com.java2s; public class Main { public static Float toFloat(String s) { try {//w ww . j a v a 2 s. c o m return Float.parseFloat(s); } catch (NumberFormatException e) { return new Float(0); } } }