Here you can find the source of string2float(String arg, Locale loc)
public static Float string2float(String arg, Locale loc) throws ParseException
//package com.java2s; import java.text.NumberFormat; import java.text.ParseException; import java.util.*; public class Main { public static Float string2float(String arg, Locale loc) throws ParseException { if (arg == null) { return null; }//from w w w .java 2 s.c o m NumberFormat nf = NumberFormat.getInstance(loc); return nf.parse(arg).floatValue(); } }