This implementation extracts the number's value using {@link java.lang.Number#longValue()} for all integral type values thatcan be converted to long
without loss of information, including BigInteger
values with a {@link java.math.BigInteger#bitLength() bit length} of less than 64,and {@link java.lang.Number#doubleValue()} for all other types. Itthen calls {@link #format(long,java.lang.StringBuffer,java.text.FieldPosition)}or {@link #format(double,java.lang.StringBuffer,java.text.FieldPosition)}. This may result in loss of magnitude information and precision for BigInteger
and BigDecimal
values.
@param number the number to format
@param toAppendTo the StringBuffer
to which the formattedtext is to be appended
@param pos On input: an alignment field, if desired.On output: the offsets of the alignment field.
@return the value passed in as toAppendTo
@exception IllegalArgumentException if number
isnull or not an instance of Number
.
@exception NullPointerException if toAppendTo
orpos
is null
@exception ArithmeticException if rounding is needed with roundingmode being set to RoundingMode.UNNECESSARY
@see java.text.FieldPosition
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|