public static Float stringToFloat(String s,Float defaultValue){
  try {
    return Float.parseFloat(s);
  }
 catch (  NumberFormatException nfe) {
    return defaultValue;
  }
}

public static Float stringToFloat ( String s , Float defaultValue ) { try { return Float . parseFloat ( s ) ; } catch ( NumberFormatException nfe ) { return defaultValue ; } }
convert a string to a float , falling back to a defaultvalue if the string cannot be parsed . this is useful because there are issues passing an float directly through uimafit to a component , and currently we need to pass it as a string and convert it .
