from
Create a PluralOperand from a String.
Using a String or BigDecimal instead of a float or double allows for the determination of trailing zeros and visible fraction digits, which can have an impact on number format selection depending upon the locale.
Return
PluralOperand, or empty Optional if the String cannot be parsed into a BigDecimal
Parameters
a Number, as a String. Null-safe.
Create a PluralOperand from a given Number type.
This selects the most specific type:
BigInteger, BigDecimal: handled using BigDecimal type
Double, Float: handled using double type
all others (long, int, short, byte): handled using long type
Null values will result in a NullPointerException
Return
PluralOperand
Parameters
Number
Explicitly set suppressedExponent for Compact format numbers. The exponent is explicitly denoted; e.g., fromCompact(1L, 6) is equivalent to "1 Million" However, fromCompact(1000000L, 6) will result in "1000000 million"
Return
PluralOperand
Parameters
input as a long
(must be between 0 and 21)
Explicitly set suppressedExponent for Compact format numbers.
The exponent must be explicitly denoted; e.g., fromCompact(1L, 6) is equivalent to "1 Million" However, fromCompact(1000000L, 6) will result in "1000000 million"
Note that for fromCompact(1.2, 6) the operands are (n = 1.2, i = 1200000, c = 6)
It is not possible to determine precision (trailing zeros) from double input.
Return
PluralOperand
Parameters
input as a double
(must be between 0 and 21)