ICU 72.1 72.1
|
A class that defines a quantity by which a number should be multiplied when formatting. More...
#include <numberformatter.h>
Public Member Functions | |
Scale (const Scale &other) | |
Scale & | operator= (const Scale &other) |
Scale (Scale &&src) U_NOEXCEPT | |
Scale & | operator= (Scale &&src) U_NOEXCEPT |
~Scale () | |
Scale (int32_t magnitude, impl::DecNum *arbitraryToAdopt) | |
Static Public Member Functions | |
static Scale | none () |
Do not change the value of numbers when formatting or parsing. | |
static Scale | powerOfTen (int32_t power) |
Multiply numbers by a power of ten before formatting. | |
static Scale | byDecimal (StringPiece multiplicand) |
Multiply numbers by an arbitrary value before formatting. | |
static Scale | byDouble (double multiplicand) |
Multiply numbers by an arbitrary value before formatting. | |
static Scale | byDoubleAndPowerOfTen (double multiplicand, int32_t power) |
Multiply a number by both a power of ten and by an arbitrary double value. | |
A class that defines a quantity by which a number should be multiplied when formatting.
To create a Scale, use one of the factory methods.
Definition at line 1084 of file numberformatter.h.
icu::number::Scale::~Scale | ( | ) |
icu::number::Scale::Scale | ( | int32_t | magnitude, |
impl::DecNum * | arbitraryToAdopt | ||
) |
|
static |
Multiply numbers by an arbitrary value before formatting.
Useful for unit conversions.
This method takes a string in a decimal number format with syntax as defined in the Decimal Arithmetic Specification, available at http://speleotrove.com/decimal
Also see the version of this method that takes a double.
Multiply numbers by an arbitrary value before formatting.
Useful for unit conversions.
This method takes a double; also see the version of this method that takes an exact decimal.
|
static |
Multiply a number by both a power of ten and by an arbitrary double value.
Multiply numbers by a power of ten before formatting.
Useful for combining with a percent unit:
NumberFormatter::with().unit(NoUnit::percent()).multiplier(Scale::powerOfTen(2))
Definition at line 1201 of file numberformatter.h.
Definition at line 1200 of file numberformatter.h.
Definition at line 1197 of file numberformatter.h.
Definition at line 1187 of file numberformatter.h.
Definition at line 1188 of file numberformatter.h.
Definition at line 1194 of file numberformatter.h.
Definition at line 1191 of file numberformatter.h.