is string a Float number - Android java.lang

Android examples for java.lang:Float

Description

is string a Float number

Demo Code

import java.util.Date;

public class Main{

    public static boolean isFloat(String value) {
        try {/*from   w  ww.  ja  va2  s .c  o  m*/
            Float.parseFloat(value);
            return true;
        } catch (NumberFormatException e) {
            return false;
        }
    }

}

Related Tutorials