public static double stringToDouble(String string) {
        string = string.trim();
        if (Checker.isDecimal(string)) {
            return Double.parseDouble(string);
        }
        return -1;
    }
public static double stringToDouble ( String string ) { string = string . trim ( ) ; if ( Checker . isDecimal ( string ) ) { return Double . parseDouble ( string ) ; } return - 1 ; }
将String转换成Double

@param string 需要转换为字符串

@return 转换结果，如果数值非法，则返回-1