public static boolean isFloat(final String txt){
  try {
    Float.parseFloat(txt);
    return true;
  }
 catch (  final Exception e) {
    return false;
  }
}

public static boolean isFloat ( final String txt ) { try { Float . parseFloat ( txt ) ; return true ; } catch ( final Exception e ) { return false ; } }
checks if is float .
