public static double parseDoubleDefault(String s,double def){
  if (s == null) {
    return def;
  }
  try {
    return Double.parseDouble(s);
  }
 catch (  NumberFormatException e) {
    return def;
  }
}

public static double parseDoubleDefault ( String s , double def ) { if ( s == null ) { return def ; } try { return Double . parseDouble ( s ) ; } catch ( NumberFormatException e ) { return def ; } }
parses a double safely , returning a default if nothing can be sanely parsed from it .
