code: public static float parseFloat(final String str, final float def) {
          final Float result = parseFloat(str);
          if (result == null) {
              return def;
          } else {
              return result.floatValue();
          }
      }
docs: Parse a float from a String, with a default value
  
  @param str
  @param def the value to return if the String cannot be parsed