public class DecimalField
extends java.lang.Object
DecimalField class is a utility to convert
java.math.BigDecimal values to String
values that are lexicographically sortable according to the decimal value.
The string format uses the characters '0' to '9' and consists of:
{ value signum +2 }
{ exponent signum +2 }
{ exponent length -1 }
{ exponent value }
{ value (-1 if inverted) }
Only the signum is encoded if the value is zero. The exponent is not
encoded if zero. Negative values are "inverted" character by character
('0' -> 9, '1' -> '8', and so on). The same applies to the exponent.
Examples: 0 => "2" 2 => "322" (signum 1; exponent 0; value 2) 120 => "330212" (signum 1; exponent signum 1, length 1, value 2; value 12). -1 => "179" (signum -1, rest inverted; exponent 0; value 1 (-1, inverted).
Values between BigDecimal(BigInteger.ONE, Integer.MIN_VALUE) and BigDecimal(BigInteger.ONE, Integer.MAX_VALUE) are supported.
| Constructor and Description |
|---|
DecimalField()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
decimalToString(java.math.BigDecimal value)
Deprecated.
Convert a BigDecimal to a String.
|
static java.math.BigDecimal |
stringToDecimal(java.lang.String value)
Deprecated.
Convert a String to a BigDecimal.
|
public static java.lang.String decimalToString(java.math.BigDecimal value)
value - the BigDecimalpublic static java.math.BigDecimal stringToDecimal(java.lang.String value)
value - the String"Copyright © 2010 - 2018 Adobe Systems Incorporated. All Rights Reserved"