public static Number resolveNumber ( Number n ) { if ( n instanceof LazilyParsedNumber ) { try { return n . longValue ( ) ; } catch ( NumberFormatException ex ) { return n . doubleValue ( ) ; } } else { // already resolved. return n ; } }
resolve a number to a Long or double .