Here you can find the source of toFloat(final Object obj)
private static Float toFloat(final Object obj)
//package com.java2s; //License from project: Open Source License public class Main { private static Float toFloat(final Object obj) { Float f = null;//w ww. j a v a 2s . com if (obj != null) { if (obj instanceof Double) { f = ((Double) obj).floatValue(); } else if (obj instanceof Float) { f = (Float) obj; } } return f; } }