Here you can find the source of toFloat(String s)
public static float toFloat(String s)
//package com.java2s; /*/*from w w w. j a va 2s. com*/ * Copyright (C) ${year} Omry Yadan <${email}> * All rights reserved. * * See https://github.com/omry/banana/blob/master/BSD-LICENSE for licensing information */ public class Main { public static float toFloat(String s) { return toFloat(s, -1); } public static float toFloat(String s, float def) { return (s == null || s.length() == 0 || s.equals("null")) ? def : Float.parseFloat(s); } }