ICU 61.1  61.1
decimfmt.h
Go to the documentation of this file.
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 /*
4 ********************************************************************************
5 * Copyright (C) 1997-2016, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 ********************************************************************************
8 *
9 * File DECIMFMT.H
10 *
11 * Modification History:
12 *
13 * Date Name Description
14 * 02/19/97 aliu Converted from java.
15 * 03/20/97 clhuang Updated per C++ implementation.
16 * 04/03/97 aliu Rewrote parsing and formatting completely, and
17 * cleaned up and debugged. Actually works now.
18 * 04/17/97 aliu Changed DigitCount to int per code review.
19 * 07/10/97 helena Made ParsePosition a class and get rid of the function
20 * hiding problems.
21 * 09/09/97 aliu Ported over support for exponential formats.
22 * 07/20/98 stephen Changed documentation
23 * 01/30/13 emmons Added Scaling methods
24 ********************************************************************************
25 */
26 
27 #ifndef DECIMFMT_H
28 #define DECIMFMT_H
29 
30 #include "unicode/utypes.h"
36 #if !UCONFIG_NO_FORMATTING
37 
38 #include "unicode/dcfmtsym.h"
39 #include "unicode/numfmt.h"
40 #include "unicode/locid.h"
41 #include "unicode/fpositer.h"
42 #include "unicode/stringpiece.h"
43 #include "unicode/curramt.h"
44 #include "unicode/enumset.h"
45 
46 #ifndef U_HIDE_INTERNAL_API
47 
51 #if UCONFIG_FORMAT_FASTPATHS_49
52 #define UNUM_DECIMALFORMAT_INTERNAL_SIZE 16
53 #endif
54 #endif /* U_HIDE_INTERNAL_API */
55 
57 
58 class DigitList;
59 class CurrencyPluralInfo;
60 class Hashtable;
61 class UnicodeSet;
62 class FieldPositionHandler;
63 class DecimalFormatStaticSets;
64 class FixedDecimal;
65 class DecimalFormatImpl;
66 class PluralRules;
67 class VisibleDigitsWithExponent;
68 
69 // explicit template instantiation. see digitlst.h
70 // (When building DLLs for Windows this is required.)
71 #if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN
72 template class U_I18N_API EnumSet<UNumberFormatAttribute,
75 #endif
76 
676 public:
682  kPadBeforePrefix,
683  kPadAfterPrefix,
684  kPadBeforeSuffix,
685  kPadAfterSuffix
686  };
687 
704  DecimalFormat(UErrorCode& status);
705 
723  DecimalFormat(const UnicodeString& pattern,
724  UErrorCode& status);
725 
747  DecimalFormat( const UnicodeString& pattern,
748  DecimalFormatSymbols* symbolsToAdopt,
749  UErrorCode& status);
750 
751 #ifndef U_HIDE_INTERNAL_API
752 
764  DecimalFormat( const UnicodeString& pattern,
765  DecimalFormatSymbols* symbolsToAdopt,
766  UNumberFormatStyle style,
767  UErrorCode& status);
768 
769 #if UCONFIG_HAVE_PARSEALLINPUT
770 
773  void setParseAllInput(UNumberFormatAttributeValue value);
774 #endif
775 
776 #endif /* U_HIDE_INTERNAL_API */
777 
778 
789  virtual DecimalFormat& setAttribute( UNumberFormatAttribute attr,
790  int32_t newvalue,
791  UErrorCode &status);
792 
802  virtual int32_t getAttribute( UNumberFormatAttribute attr,
803  UErrorCode &status) const;
804 
805 
812  virtual void setGroupingUsed(UBool newValue);
813 
821  virtual void setParseIntegerOnly(UBool value);
822 
832  virtual void setContext(UDisplayContext value, UErrorCode& status);
833 
856  DecimalFormat( const UnicodeString& pattern,
857  DecimalFormatSymbols* symbolsToAdopt,
858  UParseError& parseError,
859  UErrorCode& status);
880  DecimalFormat( const UnicodeString& pattern,
881  const DecimalFormatSymbols& symbols,
882  UErrorCode& status);
883 
890  DecimalFormat(const DecimalFormat& source);
891 
899 
904  virtual ~DecimalFormat();
905 
913  virtual Format* clone(void) const;
914 
923  virtual UBool operator==(const Format& other) const;
924 
925 
926  using NumberFormat::format;
927 
939  virtual UnicodeString& format(double number,
940  UnicodeString& appendTo,
941  FieldPosition& pos) const;
942 
943 
956  virtual UnicodeString& format(double number,
957  UnicodeString& appendTo,
958  FieldPosition& pos,
959  UErrorCode &status) const;
960 
974  virtual UnicodeString& format(double number,
975  UnicodeString& appendTo,
976  FieldPositionIterator* posIter,
977  UErrorCode& status) const;
978 
990  virtual UnicodeString& format(int32_t number,
991  UnicodeString& appendTo,
992  FieldPosition& pos) const;
993 
1005  virtual UnicodeString& format(int32_t number,
1006  UnicodeString& appendTo,
1007  FieldPosition& pos,
1008  UErrorCode &status) const;
1009 
1023  virtual UnicodeString& format(int32_t number,
1024  UnicodeString& appendTo,
1025  FieldPositionIterator* posIter,
1026  UErrorCode& status) const;
1027 
1039  virtual UnicodeString& format(int64_t number,
1040  UnicodeString& appendTo,
1041  FieldPosition& pos) const;
1042 
1054  virtual UnicodeString& format(int64_t number,
1055  UnicodeString& appendTo,
1056  FieldPosition& pos,
1057  UErrorCode &status) const;
1058 
1072  virtual UnicodeString& format(int64_t number,
1073  UnicodeString& appendTo,
1074  FieldPositionIterator* posIter,
1075  UErrorCode& status) const;
1076 
1093  virtual UnicodeString& format(StringPiece number,
1094  UnicodeString& appendTo,
1095  FieldPositionIterator* posIter,
1096  UErrorCode& status) const;
1097 
1098 
1114  virtual UnicodeString& format(const DigitList &number,
1115  UnicodeString& appendTo,
1116  FieldPositionIterator* posIter,
1117  UErrorCode& status) const;
1118 
1130  virtual UnicodeString& format(
1131  const VisibleDigitsWithExponent &number,
1132  UnicodeString& appendTo,
1133  FieldPosition& pos,
1134  UErrorCode& status) const;
1135 
1147  virtual UnicodeString& format(
1148  const VisibleDigitsWithExponent &number,
1149  UnicodeString& appendTo,
1150  FieldPositionIterator* posIter,
1151  UErrorCode& status) const;
1152 
1168  virtual UnicodeString& format(const DigitList &number,
1169  UnicodeString& appendTo,
1170  FieldPosition& pos,
1171  UErrorCode& status) const;
1172 
1173  using NumberFormat::parse;
1174 
1194  virtual void parse(const UnicodeString& text,
1195  Formattable& result,
1196  ParsePosition& parsePosition) const;
1197 
1217  virtual CurrencyAmount* parseCurrency(const UnicodeString& text,
1218  ParsePosition& pos) const;
1219 
1227  virtual const DecimalFormatSymbols* getDecimalFormatSymbols(void) const;
1228 
1235  virtual void adoptDecimalFormatSymbols(DecimalFormatSymbols* symbolsToAdopt);
1236 
1243  virtual void setDecimalFormatSymbols(const DecimalFormatSymbols& symbols);
1244 
1245 
1252  virtual const CurrencyPluralInfo* getCurrencyPluralInfo(void) const;
1253 
1260  virtual void adoptCurrencyPluralInfo(CurrencyPluralInfo* toAdopt);
1261 
1268  virtual void setCurrencyPluralInfo(const CurrencyPluralInfo& info);
1269 
1270 
1279  UnicodeString& getPositivePrefix(UnicodeString& result) const;
1280 
1288  virtual void setPositivePrefix(const UnicodeString& newValue);
1289 
1298  UnicodeString& getNegativePrefix(UnicodeString& result) const;
1299 
1307  virtual void setNegativePrefix(const UnicodeString& newValue);
1308 
1317  UnicodeString& getPositiveSuffix(UnicodeString& result) const;
1318 
1326  virtual void setPositiveSuffix(const UnicodeString& newValue);
1327 
1336  UnicodeString& getNegativeSuffix(UnicodeString& result) const;
1337 
1345  virtual void setNegativeSuffix(const UnicodeString& newValue);
1346 
1357  int32_t getMultiplier(void) const;
1358 
1369  virtual void setMultiplier(int32_t newValue);
1370 
1380  virtual double getRoundingIncrement(void) const;
1381 
1393  virtual void setRoundingIncrement(double newValue);
1394 
1403  virtual ERoundingMode getRoundingMode(void) const;
1404 
1413  virtual void setRoundingMode(ERoundingMode roundingMode);
1414 
1426  virtual int32_t getFormatWidth(void) const;
1427 
1442  virtual void setFormatWidth(int32_t width);
1443 
1456  virtual UnicodeString getPadCharacterString() const;
1457 
1472  virtual void setPadCharacter(const UnicodeString &padChar);
1473 
1489  virtual EPadPosition getPadPosition(void) const;
1490 
1507  virtual void setPadPosition(EPadPosition padPos);
1508 
1519  virtual UBool isScientificNotation(void) const;
1520 
1536  virtual void setScientificNotation(UBool useScientific);
1537 
1548  virtual int8_t getMinimumExponentDigits(void) const;
1549 
1562  virtual void setMinimumExponentDigits(int8_t minExpDig);
1563 
1576  virtual UBool isExponentSignAlwaysShown(void) const;
1577 
1591  virtual void setExponentSignAlwaysShown(UBool expSignAlways);
1592 
1604  int32_t getGroupingSize(void) const;
1605 
1617  virtual void setGroupingSize(int32_t newValue);
1618 
1637  int32_t getSecondaryGroupingSize(void) const;
1638 
1650  virtual void setSecondaryGroupingSize(int32_t newValue);
1651 
1652 #ifndef U_HIDE_INTERNAL_API
1653 
1675  int32_t getMinimumGroupingDigits() const;
1676 
1677 #endif /* U_HIDE_INTERNAL_API */
1678 
1679  /* Cannot use #ifndef U_HIDE_INTERNAL_API for the following draft method since it is virtual. */
1688  virtual void setMinimumGroupingDigits(int32_t newValue);
1689 
1690 
1699  UBool isDecimalSeparatorAlwaysShown(void) const;
1700 
1709  virtual void setDecimalSeparatorAlwaysShown(UBool newValue);
1710 
1717  UBool isDecimalPatternMatchRequired(void) const;
1718 
1728  virtual void setDecimalPatternMatchRequired(UBool newValue);
1729 
1730 
1741  virtual UnicodeString& toPattern(UnicodeString& result) const;
1742 
1753  virtual UnicodeString& toLocalizedPattern(UnicodeString& result) const;
1754 
1784  virtual void applyPattern(const UnicodeString& pattern,
1785  UParseError& parseError,
1786  UErrorCode& status);
1795  virtual void applyPattern(const UnicodeString& pattern,
1796  UErrorCode& status);
1797 
1828  virtual void applyLocalizedPattern(const UnicodeString& pattern,
1829  UParseError& parseError,
1830  UErrorCode& status);
1831 
1841  virtual void applyLocalizedPattern(const UnicodeString& pattern,
1842  UErrorCode& status);
1843 
1844 
1854  virtual void setMaximumIntegerDigits(int32_t newValue);
1855 
1865  virtual void setMinimumIntegerDigits(int32_t newValue);
1866 
1876  virtual void setMaximumFractionDigits(int32_t newValue);
1877 
1887  virtual void setMinimumFractionDigits(int32_t newValue);
1888 
1896  int32_t getMinimumSignificantDigits() const;
1897 
1905  int32_t getMaximumSignificantDigits() const;
1906 
1918  void setMinimumSignificantDigits(int32_t min);
1919 
1931  void setMaximumSignificantDigits(int32_t max);
1932 
1939  UBool areSignificantDigitsUsed() const;
1940 
1948  void setSignificantDigitsUsed(UBool useSignificantDigits);
1949 
1950  public:
1963  virtual void setCurrency(const char16_t* theCurrency, UErrorCode& ec);
1964 
1970  virtual void setCurrency(const char16_t* theCurrency);
1971 
1979  void setCurrencyUsage(UCurrencyUsage newUsage, UErrorCode* ec);
1980 
1985  UCurrencyUsage getCurrencyUsage() const;
1986 
1987 
1988 #ifndef U_HIDE_DEPRECATED_API
1989 
1994  static const char fgNumberPatterns[];
1995 #endif // U_HIDE_DEPRECATED_API
1996 
1997 #ifndef U_HIDE_INTERNAL_API
1998 
2004  FixedDecimal getFixedDecimal(double number, UErrorCode &status) const;
2005 
2012  FixedDecimal getFixedDecimal(const Formattable &number, UErrorCode &status) const;
2013 
2020  FixedDecimal getFixedDecimal(DigitList &number, UErrorCode &status) const;
2021 
2028  VisibleDigitsWithExponent &initVisibleDigitsWithExponent(
2029  double number,
2030  VisibleDigitsWithExponent &digits,
2031  UErrorCode &status) const;
2032 
2039  VisibleDigitsWithExponent &initVisibleDigitsWithExponent(
2040  const Formattable &number,
2041  VisibleDigitsWithExponent &digits,
2042  UErrorCode &status) const;
2043 
2051  VisibleDigitsWithExponent &initVisibleDigitsWithExponent(
2052  DigitList &number,
2053  VisibleDigitsWithExponent &digits,
2054  UErrorCode &status) const;
2055 
2056 #endif /* U_HIDE_INTERNAL_API */
2057 
2058 public:
2059 
2071  static UClassID U_EXPORT2 getStaticClassID(void);
2072 
2084  virtual UClassID getDynamicClassID(void) const;
2085 
2086 private:
2087 
2088  DecimalFormat(); // default constructor not implemented
2089 
2094  void init();
2095 
2099  void construct(UErrorCode& status,
2100  UParseError& parseErr,
2101  const UnicodeString* pattern = 0,
2102  DecimalFormatSymbols* symbolsToAdopt = 0
2103  );
2104 
2105  void handleCurrencySignInPattern(UErrorCode& status);
2106 
2107  void parse(const UnicodeString& text,
2108  Formattable& result,
2109  ParsePosition& pos,
2110  char16_t* currency) const;
2111 
2112  enum {
2113  fgStatusInfinite,
2114  fgStatusLength // Leave last in list.
2115  } StatusFlags;
2116 
2117  UBool subparse(const UnicodeString& text,
2118  const UnicodeString* negPrefix,
2119  const UnicodeString* negSuffix,
2120  const UnicodeString* posPrefix,
2121  const UnicodeString* posSuffix,
2122  UBool complexCurrencyParsing,
2123  int8_t type,
2124  ParsePosition& parsePosition,
2125  DigitList& digits, UBool* status,
2126  char16_t* currency) const;
2127 
2128  // Mixed style parsing for currency.
2129  // It parses against the current currency pattern
2130  // using complex affix comparison
2131  // parses against the currency plural patterns using complex affix comparison,
2132  // and parses against the current pattern using simple affix comparison.
2133  UBool parseForCurrency(const UnicodeString& text,
2134  ParsePosition& parsePosition,
2135  DigitList& digits,
2136  UBool* status,
2137  char16_t* currency) const;
2138 
2139  int32_t skipPadding(const UnicodeString& text, int32_t position) const;
2140 
2141  int32_t compareAffix(const UnicodeString& input,
2142  int32_t pos,
2143  UBool isNegative,
2144  UBool isPrefix,
2145  const UnicodeString* affixPat,
2146  UBool complexCurrencyParsing,
2147  int8_t type,
2148  char16_t* currency) const;
2149 
2150  static UnicodeString& trimMarksFromAffix(const UnicodeString& affix, UnicodeString& trimmedAffix);
2151 
2152  UBool equalWithSignCompatibility(UChar32 lhs, UChar32 rhs) const;
2153 
2154  int32_t compareSimpleAffix(const UnicodeString& affix,
2155  const UnicodeString& input,
2156  int32_t pos,
2157  UBool lenient) const;
2158 
2159  static int32_t skipPatternWhiteSpace(const UnicodeString& text, int32_t pos);
2160 
2161  static int32_t skipUWhiteSpace(const UnicodeString& text, int32_t pos);
2162 
2163  static int32_t skipUWhiteSpaceAndMarks(const UnicodeString& text, int32_t pos);
2164 
2165  static int32_t skipBidiMarks(const UnicodeString& text, int32_t pos);
2166 
2167  int32_t compareComplexAffix(const UnicodeString& affixPat,
2168  const UnicodeString& input,
2169  int32_t pos,
2170  int8_t type,
2171  char16_t* currency) const;
2172 
2173  static int32_t match(const UnicodeString& text, int32_t pos, UChar32 ch);
2174 
2175  static int32_t match(const UnicodeString& text, int32_t pos, const UnicodeString& str);
2176 
2177  static UBool matchSymbol(const UnicodeString &text, int32_t position, int32_t length, const UnicodeString &symbol,
2178  UnicodeSet *sset, UChar32 schar);
2179 
2180  static UBool matchDecimal(UChar32 symbolChar,
2181  UBool sawDecimal, UChar32 sawDecimalChar,
2182  const UnicodeSet *sset, UChar32 schar);
2183 
2184  static UBool matchGrouping(UChar32 groupingChar,
2185  UBool sawGrouping, UChar32 sawGroupingChar,
2186  const UnicodeSet *sset,
2187  UChar32 decimalChar, const UnicodeSet *decimalSet,
2188  UChar32 schar);
2189 
2190  // set up currency affix patterns for mix parsing.
2191  // The patterns saved here are the affix patterns of default currency
2192  // pattern and the unique affix patterns of the plural currency patterns.
2193  // Those patterns are used by parseForCurrency().
2194  void setupCurrencyAffixPatterns(UErrorCode& status);
2195 
2196  // get the currency rounding with respect to currency usage
2197  double getCurrencyRounding(const char16_t* currency,
2198  UErrorCode* ec) const;
2199 
2200  // get the currency fraction with respect to currency usage
2201  int getCurrencyFractionDigits(const char16_t* currency,
2202  UErrorCode* ec) const;
2203 
2204  // hashtable operations
2205  Hashtable* initHashForAffixPattern(UErrorCode& status);
2206 
2207  void deleteHashForAffixPattern();
2208 
2209  void copyHashForAffixPattern(const Hashtable* source,
2210  Hashtable* target, UErrorCode& status);
2211 
2212  DecimalFormatImpl *fImpl;
2213 
2222  fBoolFlags;
2223 
2224 
2225  // style is only valid when decimal formatter is constructed by
2226  // DecimalFormat(pattern, decimalFormatSymbol, style)
2227  int fStyle;
2228 
2229 
2230  // Affix pattern set for currency.
2231  // It is a set of AffixPatternsForCurrency,
2232  // each element of the set saves the negative prefix pattern,
2233  // negative suffix pattern, positive prefix pattern,
2234  // and positive suffix pattern of a pattern.
2235  // It is used for currency mixed style parsing.
2236  // It is actually is a set.
2237  // The set contains the default currency pattern from the locale,
2238  // and the currency plural patterns.
2239  // Since it is a set, it does not contain duplicated items.
2240  // For example, if 2 currency plural patterns are the same, only one pattern
2241  // is included in the set. When parsing, we do not check whether the plural
2242  // count match or not.
2243  Hashtable* fAffixPatternsForCurrency;
2244 
2245  // Information needed for DecimalFormat to format/parse currency plural.
2246  CurrencyPluralInfo* fCurrencyPluralInfo;
2247 
2248 #if UCONFIG_HAVE_PARSEALLINPUT
2249  UNumberFormatAttributeValue fParseAllInput;
2250 #endif
2251 
2252  // Decimal Format Static Sets singleton.
2253  const DecimalFormatStaticSets *fStaticSets;
2254 
2255 protected:
2256 
2257 #ifndef U_HIDE_INTERNAL_API
2258 
2262  DigitList& _round(const DigitList& number, DigitList& adjustedNum, UBool& isNegative, UErrorCode& status) const;
2263 #endif /* U_HIDE_INTERNAL_API */
2264 
2273  virtual void getEffectiveCurrency(char16_t* result, UErrorCode& ec) const;
2274 
2278  static const int32_t kDoubleIntegerDigits;
2282  static const int32_t kDoubleFractionDigits;
2283 
2294  static const int32_t kMaxScientificIntegerDigits;
2295 
2296 };
2297 
2299 
2300 #endif /* #if !UCONFIG_NO_FORMATTING */
2301 
2302 #endif // _DECIMFMT
2303 //eof
Base class for all formats.
Definition: format.h:96
virtual ERoundingMode getRoundingMode(void) const
Get the rounding mode.
This class represents the set of symbols needed by DecimalFormat to format numbers.
Definition: dcfmtsym.h:84
virtual UClassID getDynamicClassID(void) const =0
Returns a unique class ID POLYMORPHICALLY.
virtual void getEffectiveCurrency(char16_t *result, UErrorCode &ec) const
Returns the currency in effect for this formatter.
enum bitset for boolean fields.
Definition: enumset.h:33
virtual void parse(const UnicodeString &text, Formattable &result, ParsePosition &parsePosition) const =0
Return a long if possible (e.g.
C++ API: FieldPosition Iterator.
UDisplayContext
Display context settings.
static const int32_t kMaxScientificIntegerDigits
When someone turns on scientific mode, we assume that more than this number of digits is due to flipp...
Definition: decimfmt.h:2294
virtual void setMinimumIntegerDigits(int32_t newValue)
Sets the minimum number of digits allowed in the integer portion of a number.
virtual void setRoundingMode(ERoundingMode roundingMode)
Set the rounding mode.
void * UClassID
UClassID is used to identify classes without using the compiler&#39;s RTTI.
Definition: uobject.h:93
virtual Format * clone() const =0
Clone this object polymorphically.
Limit of boolean attributes.
Definition: unum.h:1070
virtual void setMinimumFractionDigits(int32_t newValue)
Sets the minimum number of digits allowed in the fraction portion of a number.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
Definition: utypes.h:360
C++ API: StringPiece: Read-only byte string wrapper class.
C++ API: Currency Amount Object.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:137
UNumberFormatStyle
The possible number format styles.
Definition: unum.h:145
FieldPositionIterator returns the field ids and their start/limit positions generated by a call to Fo...
Definition: fpositer.h:62
virtual void setGroupingUsed(UBool newValue)
Set whether or not grouping will be used in this format.
UCurrencyUsage
Currency Usage used for Decimal Format.
Definition: ucurr.h:41
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
Definition: umachine.h:400
virtual void setParseIntegerOnly(UBool value)
Sets whether or not numbers should be parsed as integers only.
virtual CurrencyAmount * parseCurrency(const UnicodeString &text, ParsePosition &pos) const
Parses text from the given string as a currency amount.
EPadPosition
Pad position.
Definition: decimfmt.h:681
A mutable set of Unicode characters and multicharacter strings.
Definition: uniset.h:278
One below the first bitfield-boolean item.
Definition: unum.h:1041
virtual UBool operator==(const Format &other) const
Return true if the given Format objects are semantically equal.
virtual void setMaximumIntegerDigits(int32_t newValue)
Sets the maximum number of digits allowed in the integer portion of a number.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:138
virtual void setContext(UDisplayContext value, UErrorCode &status)
Set a particular UDisplayContext value in the formatter, such as UDISPCTX_CAPITALIZATION_FOR_STANDALO...
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:396
static UClassID getStaticClassID(void)
Return the class ID for this class.
FieldPosition is a simple class used by Format and its subclasses to identify fields in formatted out...
Definition: fieldpos.h:108
ERoundingMode
Rounding mode.
Definition: numfmt.h:185
C++ API: Symbols for formatting numbers.
ParsePosition is a simple class used by Format and its subclasses to keep track of the current positi...
Definition: parsepos.h:49
virtual void setCurrency(const char16_t *theCurrency, UErrorCode &ec)
Sets the currency used to display currency amounts.
C++ API: Locale ID object.
This class represents the information needed by DecimalFormat to format currency plural, such as "3.00 US dollars" or "1.00 US dollar".
Definition: currpinf.h:46
A UParseError struct is used to returned detailed information about parsing errors.
Definition: parseerr.h:58
Basic definitions for ICU, for both C and C++ APIs.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
Definition: unistr.h:286
Formattable objects can be passed to the Format class or its subclasses for formatting.
Definition: fmtable.h:68
virtual UnicodeString & format(const Formattable &obj, UnicodeString &appendTo, FieldPosition &pos, UErrorCode &status) const
Format an object to produce a string.
C++: internal template EnumSet<>
C++ API: Compatibility APIs for number formatting.
UNumberFormatAttribute
The possible UNumberFormat numeric attributes.
Definition: unum.h:955
A string-like object that points to a sized piece of memory.
Definition: stringpiece.h:54
virtual void setMaximumFractionDigits(int32_t newValue)
Sets the maximum number of digits allowed in the fraction portion of a number.
NumberFormat & operator=(const NumberFormat &)
Assignment operator.
static const int32_t kDoubleIntegerDigits
number of integer digits
Definition: decimfmt.h:2278
A currency together with a numeric amount, such as 200 USD.
Definition: curramt.h:37
static const int32_t kDoubleFractionDigits
number of fraction digits
Definition: decimfmt.h:2282
int8_t UBool
The ICU boolean type.
Definition: umachine.h:236