Java String to Float asFloat(String v)

Here you can find the source of asFloat(String v)

Description

as Float

License

Apache License

Declaration

public static Float asFloat(String v) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static Float asFloat(String v) {
        try {//from  www.  j av  a2  s .c  om
            return (v != null) ? Float.valueOf(v) : null;
        } catch (NumberFormatException ex) {
            return null;
        }
    }
}

Related

  1. asFloat(final String str, final float def)
  2. asFloat(String string)
  3. asFloat(String value)
  4. atof(final String str, final float def)