BigDecimal value; the supported syntax is compatible with
BigDecimal#BigDecimal(String).
Syntax
Parses a BigDecimalString that is compatible with
the grammar specified in BigDecimal#BigDecimal(String).
Formal specification of the grammar:
- BigDecimalString:
- [Sign] Significand [Exponent]
- Sign:
- +
- -
- Significand:
- IntegerPart
.[FractionPart].FractionPart- IntegerPart
- IntegerPart:
- Digits
- FractionPart:
- Digits
- DecExponent:
- ExponentIndicator SignedInteger
- ExponentIndicator:
- e
- E
- SignedInteger:
- [Sign] Digits
- Digits:
- Digit {Digit}
Character lengths accepted by BigInteger#BigInteger(String):
Significand: 1 to 1,292,782,621 decimal digits.
The resulting value must fit into 2^31 - 1 bits. The decimal
representation of the value 2^31 - 1 has 646,456,993 digits.
Therefore an input String can only contain up to that many significant
digits - the remaining digits must be leading zeroes.
SignedInteger in exponent: 1 to 10 digits. Exponents
with more digits would yield to a BigDecimal#scale() that
does not fit into a int-value.BigDecimalString: 1 to 1,292,782,621+4+10=1,292,782,635
characters,
e.g. "-1.234567890....12345E-2147483647".BigDecimalString: 1,292,782,635 characters.References:
| Modifier and Type | Field and Description |
|---|---|
| private static final JavaBigDecimalFromByteArray | |
| private static final JavaBigDecimalFromCharArray | |
| private static final JavaBigDecimalFromCharSequence |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static BigDecimal | Returns: the parsed valuethe string to be parsed str)Convenience method for calling |
| public static BigDecimal | Returns: the parsed valuethe string to be parsed str, int the start offset of the offset, int FloatingPointLiteral in strthe length of length)FloatingPointLiteral in strParses a |
| public static BigDecimal | Returns: the parsed valuethe string to be parsed, a byte array with characters
in ISO-8859-1, ASCII or UTF-8 encoding str)Convenience method for calling |
| public static BigDecimal | Returns: the parsed valuethe string to be parsed, a byte array with characters
in ISO-8859-1, ASCII or UTF-8 encoding str, int The index of the first byte to parse offset, int The number of bytes to parse length)Parses a |
| public static BigDecimal | Returns: the parsed valuethe string to be parsed str)Convenience method for calling |
| public static BigDecimal | Returns: the parsed valuethe string to be parsed, a byte array with characters
in ISO-8859-1, ASCII or UTF-8 encoding str, int The index of the first character to parse offset, int The number of characters to parse length)Parses a |
| BYTE_ARRAY_PARSER | back to summary |
|---|---|
| private static final JavaBigDecimalFromByteArray BYTE_ARRAY_PARSER | |
| CHAR_ARRAY_PARSER | back to summary |
|---|---|
| private static final JavaBigDecimalFromCharArray CHAR_ARRAY_PARSER | |
| CHAR_SEQUENCE_PARSER | back to summary |
|---|---|
| private static final JavaBigDecimalFromCharSequence CHAR_SEQUENCE_PARSER | |
| JavaBigDecimalParser | back to summary |
|---|---|
| private JavaBigDecimalParser() Don't let anyone instantiate this class. | |
| parseBigDecimal | back to summary |
|---|---|
| public static BigDecimal parseBigDecimal(CharSequence str) throws NumberFormatException Convenience method for calling
| |
| parseBigDecimal | back to summary |
|---|---|
| public static BigDecimal parseBigDecimal(CharSequence str, int offset, int length) throws NumberFormatException Parses a
| |
| parseBigDecimal | back to summary |
|---|---|
| public static BigDecimal parseBigDecimal(byte[] str) throws NumberFormatException Convenience method for calling
| |
| parseBigDecimal | back to summary |
|---|---|
| public static BigDecimal parseBigDecimal(byte[] str, int offset, int length) throws NumberFormatException Parses a
| |
| parseBigDecimal | back to summary |
|---|---|
| public static BigDecimal parseBigDecimal(char[] str) throws NumberFormatException Convenience method for calling
| |
| parseBigDecimal | back to summary |
|---|---|
| public static BigDecimal parseBigDecimal(char[] str, int offset, int length) throws NumberFormatException Parses a
See
| |