Scale
open class Scale
kotlin.Any | |
↳ | android.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.
Summary
Public methods | |
---|---|
open static Scale! |
byBigDecimal(multiplicand: BigDecimal!) Multiply numbers by an arbitrary value before formatting. |
open static Scale! |
Multiply numbers by an arbitrary value before formatting. |
open static Scale! |
byDoubleAndPowerOfTen(multiplicand: Double, power: Int) Multiply a number by both a power of ten and by an arbitrary double value before formatting. |
open static Scale! |
none() Do not change the value of numbers when formatting or parsing. |
open static Scale! |
powerOfTen(power: Int) Multiply numbers by 100 before formatting. |
Public methods
byBigDecimal
open static fun byBigDecimal(multiplicand: BigDecimal!): Scale!
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.
Return | |
---|---|
Scale! |
A Multiplier for passing to the setter in NumberFormatter. |
See Also
byDouble
open static fun byDouble(multiplicand: Double): Scale!
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.
Return | |
---|---|
Scale! |
A Multiplier for passing to the setter in NumberFormatter. |
See Also
byDoubleAndPowerOfTen
open static fun byDoubleAndPowerOfTen(
multiplicand: Double,
power: Int
): Scale!
Multiply a number by both a power of ten and by an arbitrary double value before formatting.
Return | |
---|---|
Scale! |
A Multiplier for passing to the setter in NumberFormatter. |
See Also
none
open static fun none(): Scale!
Do not change the value of numbers when formatting or parsing.
Return | |
---|---|
Scale! |
A Multiplier to prevent any multiplication. |
See Also
powerOfTen
open static fun powerOfTen(power: Int): Scale!
Multiply numbers by 100 before formatting. Useful for combining with a percent unit:
NumberFormatter.with().unit(NoUnit.PERCENT).multiplier(Multiplier.powerOfTen(2))
Return | |
---|---|
Scale! |
A Multiplier for passing to the setter in NumberFormatter. |
See Also