Here you can find the source of objectToFloat(Object obj)
public static float objectToFloat(Object obj)
//package com.java2s; //License from project: Apache License public class Main { public static float objectToFloat(Object obj) { return objectToFloat(obj, 0f); }//from w ww . j av a 2 s. c om public static float objectToFloat(Object obj, float added) { float result = 0; try { result = Float.parseFloat(obj.toString()); } catch (Exception e) { result = added; } return result; } }