private static boolean isFloat ( Number n ) { if ( n instanceof Float ) { return true ; } try { float f = Float . parseFloat ( String . valueOf ( n ) ) ; return ! Float . isInfinite ( f ) ; } catch ( NumberFormatException e ) { return false ; } }
Finds out if n represents a Float .