Android examples for java.lang:Float
parse string to Float
import java.util.List; import java.util.Map; public class Main{ public static float parseFloat(String str, float defaultValue) { try {//from ww w . j a va 2s.c o m return Float.parseFloat(str); } catch (NumberFormatException e) { return defaultValue; } } }