public static Double castDouble ( Object o ) { if ( o == null ) { return null ; } if ( o instanceof Number ) { return ( ( Number ) o ) . doubleValue ( ) ; } try { return Double . valueOf ( o . toString ( ) ) ; } catch ( NumberFormatException e ) { return null ; } }
Casts a value to a double . May return null .