public static double toDouble ( Object value , double defaultValue ) { if ( value == null || value . toString ( ) . trim ( ) . equals ( "" ) ) { return defaultValue ; } if ( value instanceof Double ) { return ( double ) value ; } if ( value instanceof Date ) { final Date date = ( Date ) value ; return date . getTime ( ) ; } return Double . parseDouble ( value . toString ( ) ) ; }
To double .