19 #if !UCONFIG_NO_FORMATTING 251 #ifndef U_HIDE_DEPRECATED_API 289 #ifndef U_HIDE_DEPRECATED_API 309 UNUM_PAD_BEFORE_PREFIX,
310 UNUM_PAD_AFTER_PREFIX,
311 UNUM_PAD_BEFORE_SUFFIX,
312 UNUM_PAD_AFTER_SUFFIX
378 #ifndef U_HIDE_DRAFT_API 385 #ifndef U_HIDE_DEPRECATED_API 434 const UChar* pattern,
435 int32_t patternLength,
450 #if U_SHOW_CPLUSPLUS_API 509 int32_t resultLength,
541 int32_t resultLength,
573 int32_t resultLength,
623 int32_t resultLength,
661 int32_t resultLength,
694 int32_t resultLength,
722 int32_t resultLength,
838 int32_t outBufLength,
915 const UChar *pattern,
916 int32_t patternLength,
946 #if UCONFIG_HAVE_PARSEALLINPUT 951 typedef enum UNumberFormatAttributeValue {
952 #ifndef U_HIDE_INTERNAL_API 961 UNUM_FORMAT_ATTRIBUTE_VALUE_HIDDEN
963 } UNumberFormatAttributeValue;
1013 #if UCONFIG_HAVE_PARSEALLINPUT 1018 UNUM_PARSE_ALL_INPUT = 20,
1033 #ifndef U_HIDE_DRAFT_API 1053 #ifndef U_HIDE_INTERNAL_API 1084 #ifndef U_HIDE_DRAFT_API 1104 #ifndef U_HIDE_INTERNAL_API 1252 int32_t resultLength,
1274 const UChar* newValue,
1275 int32_t newValueLength,
1296 UBool isPatternLocalized,
1298 int32_t resultLength,
1388 #ifndef U_HIDE_DEPRECATED_API
void unum_setDoubleAttribute(UNumberFormat *fmt, UNumberFormatAttribute attr, double newValue)
Set a numeric attribute associated with a UNumberFormat.
void unum_setSymbol(UNumberFormat *fmt, UNumberFormatSymbol symbol, const UChar *value, int32_t length, UErrorCode *status)
Set a symbol associated with a UNumberFormat.
UNumberFormatRoundingMode
The possible number format rounding modes.
double unum_getDoubleAttribute(const UNumberFormat *fmt, UNumberFormatAttribute attr)
Get a numeric attribute associated with a UNumberFormat.
The monetary grouping separator.
One more than the highest normal UNumberFormatStyle value.
void unum_setContext(UNumberFormat *fmt, UDisplayContext value, UErrorCode *status)
Set a particular UDisplayContext value in the formatter, such as UDISPCTX_CAPITALIZATION_FOR_STANDALO...
Numbering system rule-based format.
const char * unum_getAvailable(int32_t localeIndex)
Get a locale for which decimal formatting patterns are available.
Currency format (generic).
Decimal format ("normal" style).
void unum_applyPattern(UNumberFormat *format, UBool localized, const UChar *pattern, int32_t patternLength, UParseError *parseError, UErrorCode *status)
Set the pattern used by a UNumberFormat.
if this attribute is set to 1, specifies that, if the pattern doesn't contain an exponent, the exponent will not be parsed.
UDisplayContext
Display context settings.
Significant digit symbol.
Currency format with a currency symbol, e.g., "$1.00", using non-accounting style for negative values...
int32_t unum_parseDecimal(const UNumberFormat *fmt, const UChar *text, int32_t textLength, int32_t *parsePos, char *outBuf, int32_t outBufLength, UErrorCode *status)
Parse a number from a string into an unformatted numeric string using a UNumberFormat.
Rule-based format defined by a pattern string.
Formatting: if set to 1, whether to show the plus sign on non-negative numbers.
Lenient parse mode used by rule-based formats.
Decimal format expressed using compact notation (short form, corresponds to UNumberCompactStyle=UNUM_...
UCurrencySpacing
Constants for specifying currency spacing.
double unum_parseDoubleCurrency(const UNumberFormat *fmt, const UChar *text, int32_t textLength, int32_t *parsePos, UChar *currency, UErrorCode *status)
Parse a string into a double and a currency using a UNumberFormat.
ROUND_UNNECESSARY reports an error if formatted result is not exact.
struct UFieldPositionIterator UFieldPositionIterator
C typedef for struct UFieldPositionIterator.
int32_t unum_formatInt64(const UNumberFormat *fmt, int64_t number, UChar *result, int32_t resultLength, UFieldPosition *pos, UErrorCode *status)
Format an int64 using a UNumberFormat.
int32_t unum_format(const UNumberFormat *fmt, int32_t number, UChar *result, int32_t resultLength, UFieldPosition *pos, UErrorCode *status)
Format an integer using a UNumberFormat.
Limit of boolean attributes.
UNumberFormatSymbol
Constants for specifying a number format symbol.
Half-even rounding, misspelled name.
C API: Display context types (enum values)
Currency format with an ISO currency code, e.g., "USD1.00".
int32_t unum_formatUFormattable(const UNumberFormat *fmt, const UFormattable *number, UChar *result, int32_t resultLength, UFieldPosition *pos, UErrorCode *status)
Format a UFormattable into a string.
Currency format with a currency symbol given CASH usage, e.g., "NT$3" instead of "NT$3.23".
int64_t unum_parseInt64(const UNumberFormat *fmt, const UChar *text, int32_t textLength, int32_t *parsePos, UErrorCode *status)
Parse a string into an int64 using a UNumberFormat.
Decimal format defined by a pattern string.
The position at which padding will take place.
Decimal format expressed using compact notation (long form, corresponds to UNumberCompactStyle=UNUM_L...
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Spellout rule-based format.
int32_t unum_getTextAttribute(const UNumberFormat *fmt, UNumberFormatTextAttribute tag, UChar *result, int32_t resultLength, UErrorCode *status)
Get a text attribute associated with a UNumberFormat.
UNumberFormatStyle
The possible number format styles.
int32_t unum_countAvailable(void)
Determine how many locales have decimal formatting patterns available.
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
void * UNumberFormat
A number formatter.
A struct representing a range of text containing a specific field.
UNumberFormatFields
FieldPosition and UFieldPosition selectors for format fields defined by NumberFormat and UNumberForma...
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
C API: Encapsulates information about a currency.
Maximum significant digits.
Currency format with a pluralized currency name, e.g., "1.00 US dollar" and "3.00 US dollars"...
One more than the highest normal UNumberFormatSymbol value.
Scale, which adjusts the position of the decimal point when formatting.
UNumberFormatTextAttribute
The possible UNumberFormat text attributes.
UNumberFormat * unum_clone(const UNumberFormat *fmt, UErrorCode *status)
Open a copy of a UNumberFormat.
Parsing: if set to 1, parsing is sensitive to case (lowercase/uppercase).
The width to which the output of format() is padded.
Alias for UNUM_PATTERN_DECIMAL.
One below the first bitfield-boolean item.
UNumberFormatPadPosition
The possible number format pad positions.
UDisplayContext unum_getContext(const UNumberFormat *fmt, UDisplayContextType type, UErrorCode *status)
Get the formatter's UDisplayContext value for the specified UDisplayContextType, such as UDISPCTX_TYP...
Minimum grouping digits; most commonly set to 2 to print "1000" instead of "1,000".
int32_t unum_formatDouble(const UNumberFormat *fmt, double number, UChar *result, int32_t resultLength, UFieldPosition *pos, UErrorCode *status)
Format a double using a UNumberFormat.
If 1, specifies that if setting the "max integer digits" attribute would truncate a value...
uint16_t UChar
The base type for UTF-16 code units and pointers.
const char * unum_getLocaleByType(const UNumberFormat *fmt, ULocDataLocaleType type, UErrorCode *status)
Get the locale for this number format object.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
UNumberCompactStyle
Constants for specifying short or long format.
UDisplayContextType
Display context types, for getting values of a particular setting.
Ordinal rule-based format .
Escape padding character.
C API: Parse Error Information.
void unum_setAttribute(UNumberFormat *fmt, UNumberFormatAttribute attr, int32_t newValue)
Set a numeric attribute associated with a UNumberFormat.
The character used to pad to the format width.
if this attribute is set to 1, specifies that, if the pattern contains a decimal mark the input is re...
UNumberFormat * unum_open(UNumberFormatStyle style, const UChar *pattern, int32_t patternLength, const char *locale, UParseError *parseErr, UErrorCode *status)
Create and return a new UNumberFormat for formatting and parsing numbers.
int32_t unum_formatDoubleForFields(const UNumberFormat *format, double number, UChar *result, int32_t resultLength, UFieldPositionIterator *fpositer, UErrorCode *status)
Format a double using a UNumberFormat according to the UNumberFormat's locale, and initialize a UFiel...
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
ULocDataLocaleType
Constants for *_getLocale() Allow user to select whether she wants information on requested...
Currency format for accounting, e.g., "($3.00)" for negative currency amount instead of "-$3...
double unum_parseDouble(const UNumberFormat *fmt, const UChar *text, int32_t textLength, int32_t *parsePos, UErrorCode *status)
Parse a string into a double using a UNumberFormat.
int32_t unum_getSymbol(const UNumberFormat *fmt, UNumberFormatSymbol symbol, UChar *buffer, int32_t size, UErrorCode *status)
Get a symbol associated with a UNumberFormat.
C API: UFieldPositionIterator for use with format APIs.
Minimum significant digits.
A UParseError struct is used to returned detailed information about parsing errors.
int32_t unum_formatDoubleCurrency(const UNumberFormat *fmt, double number, UChar *currency, UChar *result, int32_t resultLength, UFieldPosition *pos, UErrorCode *status)
Format a double currency amount using a UNumberFormat.
Basic definitions for ICU, for both C and C++ APIs.
UFormattable * unum_parseToUFormattable(const UNumberFormat *fmt, UFormattable *result, const UChar *text, int32_t textLength, int32_t *parsePos, UErrorCode *status)
Parse a UChar string into a UFormattable.
The international currency symbol.
int32_t unum_getAttribute(const UNumberFormat *fmt, UNumberFormatAttribute attr)
Get a numeric attribute associated with a UNumberFormat.
The default rule set, such as "%spellout-numbering-year:", "%spellout-cardinal:", "%spellout-ordinal-...
int32_t unum_toPattern(const UNumberFormat *fmt, UBool isPatternLocalized, UChar *result, int32_t resultLength, UErrorCode *status)
Extract the pattern from a UNumberFormat.
int32_t unum_formatDecimal(const UNumberFormat *fmt, const char *number, int32_t length, UChar *result, int32_t resultLength, UFieldPosition *pos, UErrorCode *status)
Format a decimal number using a UNumberFormat.
if this attribute is set to 0, it is set to UNUM_CURRENCY_STANDARD purpose, otherwise it is UNUM_CURR...
Duration rule-based format.
UNumberFormatAttribute
The possible UNumberFormat numeric attributes.
void unum_close(UNumberFormat *fmt)
Close a UNumberFormat.
One more than the highest normal UNumberFormatFields value.
One more than the highest normal UCurrencySpacing value.
int32_t unum_parse(const UNumberFormat *fmt, const UChar *text, int32_t textLength, int32_t *parsePos, UErrorCode *status)
Parse a string into an integer using a UNumberFormat.
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
int8_t UBool
The ICU boolean type.
Character representing a digit in the pattern.
Always show decimal point.
void unum_setTextAttribute(UNumberFormat *fmt, UNumberFormatTextAttribute tag, const UChar *newValue, int32_t newValueLength, UErrorCode *status)
Set a text attribute associated with a UNumberFormat.