Serializable
, Comparable<NumberFormatter.SignDisplay>
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 | 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.
|
ALWAYS |
Show the minus sign on negative numbers and the plus sign on positive numbers.
|
AUTO |
Show the minus sign on negative numbers, and do not show the sign on positive numbers.
|
NEVER |
Do not show the sign on positive or negative numbers.
|
Modifier and Type | Method | 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
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
NumberFormatter
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.