| Modifier and Type | Field and Description |
|---|---|
| private static final int | MAX_FRACTION_DIGITS
Maximum number of fraction digits supported by the format methods |
| private static final long[] | POWER_OF_TENS
Contains the power of ten values for fast lookup in the format methods |
| private static final int[] |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static int | Returns: The number of bytes used in the buffer or-1 if formatting failedThe float value to format value, int The maximum number of fraction digits used maxFractionDigits, byte[] The output buffer to write the formatted value to asciiBuffer)Fast variant to format a floating point value to a ASCII-string. |
| private static int | Returns: The offset into the buffer which contains the first byte that was not filled by the methodThe number to format number, int The start digit exp, boolean Whether the formatting should stop if only trailing zeros are left.
This is needed e.g. when formatting fractions of a number. omitTrailingZeros, byte[] The buffer to write the ASCII digits to asciiBuffer, int The start offset into the buffer to start writing startOffset)Formats a positive integer number starting with the digit at |
| private static int |
| MAX_FRACTION_DIGITS | back to summary |
|---|---|
| private static final int MAX_FRACTION_DIGITS Maximum number of fraction digits supported by the format methods | |
| POWER_OF_TENS | back to summary |
|---|---|
| private static final long[] POWER_OF_TENS Contains the power of ten values for fast lookup in the format methods | |
| POWER_OF_TENS_INT | back to summary |
|---|---|
| private static final int[] POWER_OF_TENS_INT | |
| NumberFormatUtil | back to summary |
|---|---|
| private NumberFormatUtil() | |
| formatFloatFast | back to summary |
|---|---|
| public static int formatFloatFast(float value, int maxFractionDigits, byte[] asciiBuffer) Fast variant to format a floating point value to a ASCII-string. The format will fail if the
value is greater than
| |
| formatPositiveNumber | back to summary |
|---|---|
| private static int formatPositiveNumber(long number, int exp, boolean omitTrailingZeros, byte[] asciiBuffer, int startOffset) Formats a positive integer number starting with the digit at
| |
| getExponent | back to summary |
|---|---|
| private static int getExponent(long number) Returns the highest exponent of 10 where | |