Class Scale
java.lang.Object
com.ibm.icu.number.Scale
A class that defines a quantity by which a number should be multiplied when formatting.
To create a Multiplier, use one of the factory methods.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final BigDecimalprivate static final BigDecimalprivate static final BigDecimalprivate static final Scaleprivate static final Scale(package private) final int(package private) final MathContext(package private) final BigDecimalprivate static final Scale -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateScale(int magnitude, BigDecimal arbitrary) privateScale(int magnitude, BigDecimal arbitrary, MathContext mc) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyReciprocalTo(DecimalQuantity quantity) Deprecated.ICU 62 This API is ICU internal only.voidapplyTo(DecimalQuantity quantity) Deprecated.ICU 62 This API is ICU internal only.static ScalebyBigDecimal(BigDecimal multiplicand) Multiply numbers by an arbitrary value before formatting.static ScalebyDouble(double multiplicand) Multiply numbers by an arbitrary value before formatting.static ScalebyDoubleAndPowerOfTen(double multiplicand, int power) Multiply a number by both a power of ten and by an arbitrary double value before formatting.(package private) booleanisValid()Returns whether the multiplier will change the number.static Scalenone()Do not change the value of numbers when formatting or parsing.static ScalepowerOfTen(int power) Multiply numbers by 100 before formatting.Deprecated.ICU 62 This API is ICU internal only.
-
Field Details
-
DEFAULT
-
HUNDRED
-
THOUSAND
-
BIG_DECIMAL_100
-
BIG_DECIMAL_1000
-
magnitude
final int magnitude -
arbitrary
-
reciprocal
-
mc
-
-
Constructor Details
-
Scale
-
Scale
-
-
Method Details
-
none
Do not change the value of numbers when formatting or parsing.- Returns:
- A Multiplier to prevent any multiplication.
- See Also:
-
powerOfTen
Multiply numbers by 100 before formatting. Useful for combining with a percent unit:NumberFormatter.with().unit(NoUnit.PERCENT).multiplier(Multiplier.powerOfTen(2))
- Returns:
- A Multiplier for passing to the setter in NumberFormatter.
- See Also:
-
byBigDecimal
Multiply numbers by an arbitrary value before formatting. Useful for unit conversions.This method takes a BigDecimal; also see the version that takes a double.
- Returns:
- A Multiplier for passing to the setter in NumberFormatter.
- See Also:
-
byDouble
Multiply numbers by an arbitrary value before formatting. Useful for unit conversions.This method takes a double; also see the version that takes a BigDecimal.
- Returns:
- A Multiplier for passing to the setter in NumberFormatter.
- See Also:
-
byDoubleAndPowerOfTen
Multiply a number by both a power of ten and by an arbitrary double value before formatting.- Returns:
- A Multiplier for passing to the setter in NumberFormatter.
- See Also:
-
isValid
boolean isValid()Returns whether the multiplier will change the number. -
withMathContext
Deprecated.ICU 62 This API is ICU internal only. -
applyTo
Deprecated.ICU 62 This API is ICU internal only. -
applyReciprocalTo
Deprecated.ICU 62 This API is ICU internal only.
-