public static enum NumberFormatter.SignDisplay extends Enum<NumberFormatter.SignDisplay>
The exact format, including the position and the code point of the sign, differ by locale.
NumberFormatter
Enum Constant and Description |
---|
ACCOUNTING
Use the locale-dependent accounting format on negative numbers, and do not show the sign on
positive numbers.
|
ACCOUNTING_ALWAYS
Use the locale-dependent accounting format on negative numbers, and show the plus sign on
positive numbers, including zero.
|
ACCOUNTING_EXCEPT_ZERO
Use the locale-dependent accounting format on negative numbers, and show the plus sign on
positive numbers.
|
ACCOUNTING_NEGATIVE
Same as ACCOUNTING, but do not show the sign on negative zero.
|
ALWAYS
Show the minus sign on negative numbers and the plus sign on positive numbers, including zero.
|
AUTO
Show the minus sign on negative numbers, and do not show the sign on positive numbers.
|
EXCEPT_ZERO
Show the minus sign on negative numbers and the plus sign on positive numbers.
|
NEGATIVE
Same as AUTO, but do not show the sign on negative zero.
|
NEVER
Do not show the sign on positive or negative numbers.
|
Modifier and Type | Method and Description |
---|---|
static NumberFormatter.SignDisplay |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NumberFormatter.SignDisplay[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NumberFormatter.SignDisplay AUTO
NumberFormatter
public static final NumberFormatter.SignDisplay ALWAYS
EXCEPT_ZERO
.NumberFormatter
public static final NumberFormatter.SignDisplay NEVER
NumberFormatter
public static final NumberFormatter.SignDisplay ACCOUNTING
The accounting format is defined in CLDR and varies by locale; in many Western locales, the format is a pair of parentheses around the number.
Note: Since CLDR defines the accounting format in the monetary context only, this option falls back to the AUTO sign display strategy when formatting without a currency unit. This limitation may be lifted in the future.
NumberFormatter
public static final NumberFormatter.SignDisplay ACCOUNTING_ALWAYS
ACCOUNTING_EXCEPT_ZERO
.NumberFormatter
public static final NumberFormatter.SignDisplay EXCEPT_ZERO
NumberFormatter
public static final NumberFormatter.SignDisplay ACCOUNTING_EXCEPT_ZERO
NumberFormatter
public static final NumberFormatter.SignDisplay NEGATIVE
public static final NumberFormatter.SignDisplay ACCOUNTING_NEGATIVE
public static NumberFormatter.SignDisplay[] values()
for (NumberFormatter.SignDisplay c : NumberFormatter.SignDisplay.values()) System.out.println(c);
public static NumberFormatter.SignDisplay valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2016 Unicode, Inc. and others.