Here you can find the source of toFloat(Object o)
public static Float toFloat(Object o)
//package com.java2s; public class Main { public static Float toFloat(Object o) { Float f;//from w w w . ja va 2 s .com if (o instanceof Float) { f = (Float) o; } else { try { f = Float.valueOf(o.toString()); } catch (Exception e) { f = null; } } return f; } }