public static double parseDouble ( String val , double defValue ) { if ( TextUtils . isEmpty ( val ) ) return defValue ; try { return Double . parseDouble ( val ) ; } catch ( NumberFormatException e ) { return defValue ; } }
Parse a double from a String in a safe manner