Converts values to numbers, supporting any subclass of
Number
(including generic Number type), and it unboxed counterpart, using a
NumberFormat
to parse to a
Number
and to convert it to a
specific number type:
Byte, byte:
Number.byteValue()
Short, short:
Number.shortValue()
Integer, int:
Number.intValue()
Float, float:
Number.floatValue()
Long, long:
Number.longValue()
Double, double:
Number.doubleValue()
BigInteger:
BigInteger.valueOf(long)
BigDecimal:
BigDecimal.valueOf(double)
If no number format is provided, it defaults to
NumberFormat.getInstance()
.