public static float floatFromProperties(Properties p,String propName,float defaultValue){
  float ret=defaultValue;
  String floatString=p.getProperty(propName);
  if (floatString != null) {
    try {
      ret=Float.parseFloat(floatString.trim());
    }
 catch (    NumberFormatException e) {
      ret=defaultValue;
    }
  }
  return ret;
}

public static float floatFromProperties ( Properties p , String propName , float defaultValue ) { float ret = defaultValue ; String floatString = p . getProperty ( propName ) ; if ( floatString != null ) { try { ret = Float . parseFloat ( floatString . trim ( ) ) ; } catch ( NumberFormatException e ) { ret = defaultValue ; } } return ret ; }
gets an float out of a properties object . returns the default value if something goes wrong .
