Java Float Number Parse tryParseFloat(String value)

Here you can find the source of tryParseFloat(String value)

Description

Returns whether or not the String can be parsed as an Float

License

Open Source License

Declaration

public static boolean tryParseFloat(String value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from  w  ww.  j av a 2  s  .com
     * Returns whether or not the String can be parsed as an Float
     */
    public static boolean tryParseFloat(String value) {
        try {
            Float.parseFloat(value);
        } catch (NumberFormatException ex) {
            return false;
        }
        return true;
    }
}

Related

  1. readFloatFromString(String inStr)
  2. string2float(String arg, Locale loc)
  3. tryParseFloat(String floatValue)
  4. tryParseFloat(String value)
  5. tryParseFloats(String[] in)