question: public static double parseDoubleString ( String st , TExecutionContext context ) { double ret = 0 ; Matcher m = DOUBLE_PATTERN . matcher ( st ) ; if ( m . lookingAt ( ) ) { String truncated = st . substring ( 0 , m . end ( ) ) ; if ( ! truncated . equals ( st ) ) { context . reportTruncate ( st , truncated ) ; } try { ret = Double . parseDouble ( truncated ) ; } catch ( NumberFormatException e ) { context . reportBadValue ( e . getMessage ( ) ) ; } } else context . reportBadValue ( st ) ; return ret ; }
target:  Parse the st for a double value MySQL compat in that illegal digits will be truncated and won't cause NumberFormatException