ICU 76.1 76.1
|
A special NumberFormatter focused on smaller binary size and memory use. More...
#include <simplenumberformatter.h>
Public Member Functions | |
FormattedNumber | format (SimpleNumber value, UErrorCode &status) const |
Formats a value using this SimpleNumberFormatter. | |
FormattedNumber | formatInt64 (int64_t value, UErrorCode &status) const |
Formats an integer using this SimpleNumberFormatter. | |
void | formatImpl (impl::UFormattedNumberData *data, USimpleNumberSign sign, UErrorCode &status) const |
Run the formatter with the internal types. | |
~SimpleNumberFormatter () | |
Destruct this SimpleNumberFormatter, cleaning up any memory it might own. | |
SimpleNumberFormatter ()=default | |
Creates a shell, initialized but non-functional SimpleNumberFormatter. | |
SimpleNumberFormatter (SimpleNumberFormatter &&other) noexcept | |
SimpleNumberFormatter: Move constructor. | |
SimpleNumberFormatter & | operator= (SimpleNumberFormatter &&other) noexcept |
SimpleNumberFormatter: Move assignment. | |
Static Public Member Functions | |
static SimpleNumberFormatter | forLocale (const icu::Locale &locale, UErrorCode &status) |
Creates a new SimpleNumberFormatter with all locale defaults. | |
static SimpleNumberFormatter | forLocaleAndGroupingStrategy (const icu::Locale &locale, UNumberGroupingStrategy groupingStrategy, UErrorCode &status) |
Creates a new SimpleNumberFormatter, overriding the grouping strategy. | |
static SimpleNumberFormatter | forLocaleAndSymbolsAndGroupingStrategy (const icu::Locale &locale, const DecimalFormatSymbols &symbols, UNumberGroupingStrategy groupingStrategy, UErrorCode &status) |
Creates a new SimpleNumberFormatter, overriding the grouping strategy and symbols. | |
A special NumberFormatter focused on smaller binary size and memory use.
SimpleNumberFormatter is capable of basic number formatting, including grouping separators, sign display, and rounding. It is not capable of currencies, compact notation, or units.
This class is immutable and not intended for public subclassing. This class is movable but not copyable.
Definition at line 184 of file simplenumberformatter.h.
|
inline |
Destruct this SimpleNumberFormatter, cleaning up any memory it might own.
Definition at line 253 of file simplenumberformatter.h.
|
default |
Creates a shell, initialized but non-functional SimpleNumberFormatter.
|
inlinenoexcept |
SimpleNumberFormatter: Move constructor.
Definition at line 269 of file simplenumberformatter.h.
|
static |
Creates a new SimpleNumberFormatter with all locale defaults.
|
static |
Creates a new SimpleNumberFormatter, overriding the grouping strategy.
|
static |
Creates a new SimpleNumberFormatter, overriding the grouping strategy and symbols.
IMPORTANT: For efficiency, this function borrows the symbols. The symbols MUST remain valid for the lifetime of the SimpleNumberFormatter.
FormattedNumber icu::number::SimpleNumberFormatter::format | ( | SimpleNumber | value, |
UErrorCode & | status | ||
) | const |
Formats a value using this SimpleNumberFormatter.
The SimpleNumber argument is "consumed". A new SimpleNumber object should be created for every formatting operation.
void icu::number::SimpleNumberFormatter::formatImpl | ( | impl::UFormattedNumberData * | data, |
USimpleNumberSign | sign, | ||
UErrorCode & | status | ||
) | const |
Run the formatter with the internal types.
|
inline |
Formats an integer using this SimpleNumberFormatter.
For more control over the formatting, use SimpleNumber.
Definition at line 236 of file simplenumberformatter.h.
|
inlinenoexcept |
SimpleNumberFormatter: Move assignment.
Definition at line 284 of file simplenumberformatter.h.