Java Float Number Parse string2float(String arg, Locale loc)

Here you can find the source of string2float(String arg, Locale loc)

Description

stringfloat

License

Open Source License

Declaration

public static Float string2float(String arg, Locale loc)
            throws ParseException 

Method Source Code

//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();
    }
}

Related

  1. readFloatFromString(String inStr)
  2. tryParseFloat(String floatValue)
  3. tryParseFloat(String value)
  4. tryParseFloat(String value)
  5. tryParseFloats(String[] in)