ICU 60.2  60.2
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 #if defined (_MSC_VER)
71 template class U_I18N_API EnumSet<UNumberFormatAttribute,
74 #endif
75 
670 public:
676  kPadBeforePrefix,
677  kPadAfterPrefix,
678  kPadBeforeSuffix,
679  kPadAfterSuffix
680  };
681 
695  DecimalFormat(UErrorCode& status);
696 
711  DecimalFormat(const UnicodeString& pattern,
712  UErrorCode& status);
713 
732  DecimalFormat( const UnicodeString& pattern,
733  DecimalFormatSymbols* symbolsToAdopt,
734  UErrorCode& status);
735 
736 #ifndef U_HIDE_INTERNAL_API
737 
749  DecimalFormat( const UnicodeString& pattern,
750  DecimalFormatSymbols* symbolsToAdopt,
751  UNumberFormatStyle style,
752  UErrorCode& status);
753 
754 #if UCONFIG_HAVE_PARSEALLINPUT
755 
758  void setParseAllInput(UNumberFormatAttributeValue value);
759 #endif
760 
761 #endif /* U_HIDE_INTERNAL_API */
762 
763 
774  virtual DecimalFormat& setAttribute( UNumberFormatAttribute attr,
775  int32_t newvalue,
776  UErrorCode &status);
777 
787  virtual int32_t getAttribute( UNumberFormatAttribute attr,
788  UErrorCode &status) const;
789 
790 
797  virtual void setGroupingUsed(UBool newValue);
798 
806  virtual void setParseIntegerOnly(UBool value);
807 
817  virtual void setContext(UDisplayContext value, UErrorCode& status);
818 
838  DecimalFormat( const UnicodeString& pattern,
839  DecimalFormatSymbols* symbolsToAdopt,
840  UParseError& parseError,
841  UErrorCode& status);
859  DecimalFormat( const UnicodeString& pattern,
860  const DecimalFormatSymbols& symbols,
861  UErrorCode& status);
862 
869  DecimalFormat(const DecimalFormat& source);
870 
878 
883  virtual ~DecimalFormat();
884 
892  virtual Format* clone(void) const;
893 
902  virtual UBool operator==(const Format& other) const;
903 
904 
905  using NumberFormat::format;
906 
918  virtual UnicodeString& format(double number,
919  UnicodeString& appendTo,
920  FieldPosition& pos) const;
921 
922 
935  virtual UnicodeString& format(double number,
936  UnicodeString& appendTo,
937  FieldPosition& pos,
938  UErrorCode &status) const;
939 
953  virtual UnicodeString& format(double number,
954  UnicodeString& appendTo,
955  FieldPositionIterator* posIter,
956  UErrorCode& status) const;
957 
969  virtual UnicodeString& format(int32_t number,
970  UnicodeString& appendTo,
971  FieldPosition& pos) const;
972 
984  virtual UnicodeString& format(int32_t number,
985  UnicodeString& appendTo,
986  FieldPosition& pos,
987  UErrorCode &status) const;
988 
1002  virtual UnicodeString& format(int32_t number,
1003  UnicodeString& appendTo,
1004  FieldPositionIterator* posIter,
1005  UErrorCode& status) const;
1006 
1018  virtual UnicodeString& format(int64_t number,
1019  UnicodeString& appendTo,
1020  FieldPosition& pos) const;
1021 
1033  virtual UnicodeString& format(int64_t number,
1034  UnicodeString& appendTo,
1035  FieldPosition& pos,
1036  UErrorCode &status) const;
1037 
1051  virtual UnicodeString& format(int64_t number,
1052  UnicodeString& appendTo,
1053  FieldPositionIterator* posIter,
1054  UErrorCode& status) const;
1055 
1072  virtual UnicodeString& format(StringPiece number,
1073  UnicodeString& appendTo,
1074  FieldPositionIterator* posIter,
1075  UErrorCode& status) const;
1076 
1077 
1093  virtual UnicodeString& format(const DigitList &number,
1094  UnicodeString& appendTo,
1095  FieldPositionIterator* posIter,
1096  UErrorCode& status) const;
1097 
1109  virtual UnicodeString& format(
1110  const VisibleDigitsWithExponent &number,
1111  UnicodeString& appendTo,
1112  FieldPosition& pos,
1113  UErrorCode& status) const;
1114 
1126  virtual UnicodeString& format(
1127  const VisibleDigitsWithExponent &number,
1128  UnicodeString& appendTo,
1129  FieldPositionIterator* posIter,
1130  UErrorCode& status) const;
1131 
1147  virtual UnicodeString& format(const DigitList &number,
1148  UnicodeString& appendTo,
1149  FieldPosition& pos,
1150  UErrorCode& status) const;
1151 
1152  using NumberFormat::parse;
1153 
1173  virtual void parse(const UnicodeString& text,
1174  Formattable& result,
1175  ParsePosition& parsePosition) const;
1176 
1196  virtual CurrencyAmount* parseCurrency(const UnicodeString& text,
1197  ParsePosition& pos) const;
1198 
1206  virtual const DecimalFormatSymbols* getDecimalFormatSymbols(void) const;
1207 
1214  virtual void adoptDecimalFormatSymbols(DecimalFormatSymbols* symbolsToAdopt);
1215 
1222  virtual void setDecimalFormatSymbols(const DecimalFormatSymbols& symbols);
1223 
1224 
1231  virtual const CurrencyPluralInfo* getCurrencyPluralInfo(void) const;
1232 
1239  virtual void adoptCurrencyPluralInfo(CurrencyPluralInfo* toAdopt);
1240 
1247  virtual void setCurrencyPluralInfo(const CurrencyPluralInfo& info);
1248 
1249 
1258  UnicodeString& getPositivePrefix(UnicodeString& result) const;
1259 
1267  virtual void setPositivePrefix(const UnicodeString& newValue);
1268 
1277  UnicodeString& getNegativePrefix(UnicodeString& result) const;
1278 
1286  virtual void setNegativePrefix(const UnicodeString& newValue);
1287 
1296  UnicodeString& getPositiveSuffix(UnicodeString& result) const;
1297 
1305  virtual void setPositiveSuffix(const UnicodeString& newValue);
1306 
1315  UnicodeString& getNegativeSuffix(UnicodeString& result) const;
1316 
1324  virtual void setNegativeSuffix(const UnicodeString& newValue);
1325 
1336  int32_t getMultiplier(void) const;
1337 
1348  virtual void setMultiplier(int32_t newValue);
1349 
1359  virtual double getRoundingIncrement(void) const;
1360 
1372  virtual void setRoundingIncrement(double newValue);
1373 
1382  virtual ERoundingMode getRoundingMode(void) const;
1383 
1392  virtual void setRoundingMode(ERoundingMode roundingMode);
1393 
1405  virtual int32_t getFormatWidth(void) const;
1406 
1421  virtual void setFormatWidth(int32_t width);
1422 
1435  virtual UnicodeString getPadCharacterString() const;
1436 
1451  virtual void setPadCharacter(const UnicodeString &padChar);
1452 
1468  virtual EPadPosition getPadPosition(void) const;
1469 
1486  virtual void setPadPosition(EPadPosition padPos);
1487 
1498  virtual UBool isScientificNotation(void) const;
1499 
1515  virtual void setScientificNotation(UBool useScientific);
1516 
1527  virtual int8_t getMinimumExponentDigits(void) const;
1528 
1541  virtual void setMinimumExponentDigits(int8_t minExpDig);
1542 
1555  virtual UBool isExponentSignAlwaysShown(void) const;
1556 
1570  virtual void setExponentSignAlwaysShown(UBool expSignAlways);
1571 
1583  int32_t getGroupingSize(void) const;
1584 
1596  virtual void setGroupingSize(int32_t newValue);
1597 
1616  int32_t getSecondaryGroupingSize(void) const;
1617 
1629  virtual void setSecondaryGroupingSize(int32_t newValue);
1630 
1631 #ifndef U_HIDE_INTERNAL_API
1632 
1654  int32_t getMinimumGroupingDigits() const;
1655 
1656 #endif /* U_HIDE_INTERNAL_API */
1657 
1658  /* Cannot use #ifndef U_HIDE_INTERNAL_API for the following draft method since it is virtual. */
1667  virtual void setMinimumGroupingDigits(int32_t newValue);
1668 
1669 
1678  UBool isDecimalSeparatorAlwaysShown(void) const;
1679 
1688  virtual void setDecimalSeparatorAlwaysShown(UBool newValue);
1689 
1696  UBool isDecimalPatternMatchRequired(void) const;
1697 
1707  virtual void setDecimalPatternMatchRequired(UBool newValue);
1708 
1709 
1720  virtual UnicodeString& toPattern(UnicodeString& result) const;
1721 
1732  virtual UnicodeString& toLocalizedPattern(UnicodeString& result) const;
1733 
1763  virtual void applyPattern(const UnicodeString& pattern,
1764  UParseError& parseError,
1765  UErrorCode& status);
1774  virtual void applyPattern(const UnicodeString& pattern,
1775  UErrorCode& status);
1776 
1807  virtual void applyLocalizedPattern(const UnicodeString& pattern,
1808  UParseError& parseError,
1809  UErrorCode& status);
1810 
1820  virtual void applyLocalizedPattern(const UnicodeString& pattern,
1821  UErrorCode& status);
1822 
1823 
1833  virtual void setMaximumIntegerDigits(int32_t newValue);
1834 
1844  virtual void setMinimumIntegerDigits(int32_t newValue);
1845 
1855  virtual void setMaximumFractionDigits(int32_t newValue);
1856 
1866  virtual void setMinimumFractionDigits(int32_t newValue);
1867 
1875  int32_t getMinimumSignificantDigits() const;
1876 
1884  int32_t getMaximumSignificantDigits() const;
1885 
1897  void setMinimumSignificantDigits(int32_t min);
1898 
1910  void setMaximumSignificantDigits(int32_t max);
1911 
1918  UBool areSignificantDigitsUsed() const;
1919 
1927  void setSignificantDigitsUsed(UBool useSignificantDigits);
1928 
1929  public:
1942  virtual void setCurrency(const char16_t* theCurrency, UErrorCode& ec);
1943 
1949  virtual void setCurrency(const char16_t* theCurrency);
1950 
1958  void setCurrencyUsage(UCurrencyUsage newUsage, UErrorCode* ec);
1959 
1964  UCurrencyUsage getCurrencyUsage() const;
1965 
1966 
1972  static const char fgNumberPatterns[];
1973 
1974 #ifndef U_HIDE_INTERNAL_API
1975 
1981  FixedDecimal getFixedDecimal(double number, UErrorCode &status) const;
1982 
1989  FixedDecimal getFixedDecimal(const Formattable &number, UErrorCode &status) const;
1990 
1997  FixedDecimal getFixedDecimal(DigitList &number, UErrorCode &status) const;
1998 
2005  VisibleDigitsWithExponent &initVisibleDigitsWithExponent(
2006  double number,
2007  VisibleDigitsWithExponent &digits,
2008  UErrorCode &status) const;
2009 
2016  VisibleDigitsWithExponent &initVisibleDigitsWithExponent(
2017  const Formattable &number,
2018  VisibleDigitsWithExponent &digits,
2019  UErrorCode &status) const;
2020 
2028  VisibleDigitsWithExponent &initVisibleDigitsWithExponent(
2029  DigitList &number,
2030  VisibleDigitsWithExponent &digits,
2031  UErrorCode &status) const;
2032 
2033 #endif /* U_HIDE_INTERNAL_API */
2034 
2035 public:
2036 
2048  static UClassID U_EXPORT2 getStaticClassID(void);
2049 
2061  virtual UClassID getDynamicClassID(void) const;
2062 
2063 private:
2064 
2065  DecimalFormat(); // default constructor not implemented
2066 
2071  void init();
2072 
2076  void construct(UErrorCode& status,
2077  UParseError& parseErr,
2078  const UnicodeString* pattern = 0,
2079  DecimalFormatSymbols* symbolsToAdopt = 0
2080  );
2081 
2082  void handleCurrencySignInPattern(UErrorCode& status);
2083 
2084  void parse(const UnicodeString& text,
2085  Formattable& result,
2086  ParsePosition& pos,
2087  char16_t* currency) const;
2088 
2089  enum {
2090  fgStatusInfinite,
2091  fgStatusLength // Leave last in list.
2092  } StatusFlags;
2093 
2094  UBool subparse(const UnicodeString& text,
2095  const UnicodeString* negPrefix,
2096  const UnicodeString* negSuffix,
2097  const UnicodeString* posPrefix,
2098  const UnicodeString* posSuffix,
2099  UBool complexCurrencyParsing,
2100  int8_t type,
2101  ParsePosition& parsePosition,
2102  DigitList& digits, UBool* status,
2103  char16_t* currency) const;
2104 
2105  // Mixed style parsing for currency.
2106  // It parses against the current currency pattern
2107  // using complex affix comparison
2108  // parses against the currency plural patterns using complex affix comparison,
2109  // and parses against the current pattern using simple affix comparison.
2110  UBool parseForCurrency(const UnicodeString& text,
2111  ParsePosition& parsePosition,
2112  DigitList& digits,
2113  UBool* status,
2114  char16_t* currency) const;
2115 
2116  int32_t skipPadding(const UnicodeString& text, int32_t position) const;
2117 
2118  int32_t compareAffix(const UnicodeString& input,
2119  int32_t pos,
2120  UBool isNegative,
2121  UBool isPrefix,
2122  const UnicodeString* affixPat,
2123  UBool complexCurrencyParsing,
2124  int8_t type,
2125  char16_t* currency) const;
2126 
2127  static UnicodeString& trimMarksFromAffix(const UnicodeString& affix, UnicodeString& trimmedAffix);
2128 
2129  UBool equalWithSignCompatibility(UChar32 lhs, UChar32 rhs) const;
2130 
2131  int32_t compareSimpleAffix(const UnicodeString& affix,
2132  const UnicodeString& input,
2133  int32_t pos,
2134  UBool lenient) const;
2135 
2136  static int32_t skipPatternWhiteSpace(const UnicodeString& text, int32_t pos);
2137 
2138  static int32_t skipUWhiteSpace(const UnicodeString& text, int32_t pos);
2139 
2140  static int32_t skipUWhiteSpaceAndMarks(const UnicodeString& text, int32_t pos);
2141 
2142  static int32_t skipBidiMarks(const UnicodeString& text, int32_t pos);
2143 
2144  int32_t compareComplexAffix(const UnicodeString& affixPat,
2145  const UnicodeString& input,
2146  int32_t pos,
2147  int8_t type,
2148  char16_t* currency) const;
2149 
2150  static int32_t match(const UnicodeString& text, int32_t pos, UChar32 ch);
2151 
2152  static int32_t match(const UnicodeString& text, int32_t pos, const UnicodeString& str);
2153 
2154  static UBool matchSymbol(const UnicodeString &text, int32_t position, int32_t length, const UnicodeString &symbol,
2155  UnicodeSet *sset, UChar32 schar);
2156 
2157  static UBool matchDecimal(UChar32 symbolChar,
2158  UBool sawDecimal, UChar32 sawDecimalChar,
2159  const UnicodeSet *sset, UChar32 schar);
2160 
2161  static UBool matchGrouping(UChar32 groupingChar,
2162  UBool sawGrouping, UChar32 sawGroupingChar,
2163  const UnicodeSet *sset,
2164  UChar32 decimalChar, const UnicodeSet *decimalSet,
2165  UChar32 schar);
2166 
2167  // set up currency affix patterns for mix parsing.
2168  // The patterns saved here are the affix patterns of default currency
2169  // pattern and the unique affix patterns of the plural currency patterns.
2170  // Those patterns are used by parseForCurrency().
2171  void setupCurrencyAffixPatterns(UErrorCode& status);
2172 
2173  // get the currency rounding with respect to currency usage
2174  double getCurrencyRounding(const char16_t* currency,
2175  UErrorCode* ec) const;
2176 
2177  // get the currency fraction with respect to currency usage
2178  int getCurrencyFractionDigits(const char16_t* currency,
2179  UErrorCode* ec) const;
2180 
2181  // hashtable operations
2182  Hashtable* initHashForAffixPattern(UErrorCode& status);
2183 
2184  void deleteHashForAffixPattern();
2185 
2186  void copyHashForAffixPattern(const Hashtable* source,
2187  Hashtable* target, UErrorCode& status);
2188 
2189  DecimalFormatImpl *fImpl;
2190 
2199  fBoolFlags;
2200 
2201 
2202  // style is only valid when decimal formatter is constructed by
2203  // DecimalFormat(pattern, decimalFormatSymbol, style)
2204  int fStyle;
2205 
2206 
2207  // Affix pattern set for currency.
2208  // It is a set of AffixPatternsForCurrency,
2209  // each element of the set saves the negative prefix pattern,
2210  // negative suffix pattern, positive prefix pattern,
2211  // and positive suffix pattern of a pattern.
2212  // It is used for currency mixed style parsing.
2213  // It is actually is a set.
2214  // The set contains the default currency pattern from the locale,
2215  // and the currency plural patterns.
2216  // Since it is a set, it does not contain duplicated items.
2217  // For example, if 2 currency plural patterns are the same, only one pattern
2218  // is included in the set. When parsing, we do not check whether the plural
2219  // count match or not.
2220  Hashtable* fAffixPatternsForCurrency;
2221 
2222  // Information needed for DecimalFormat to format/parse currency plural.
2223  CurrencyPluralInfo* fCurrencyPluralInfo;
2224 
2225 #if UCONFIG_HAVE_PARSEALLINPUT
2226  UNumberFormatAttributeValue fParseAllInput;
2227 #endif
2228 
2229  // Decimal Format Static Sets singleton.
2230  const DecimalFormatStaticSets *fStaticSets;
2231 
2232 protected:
2233 
2234 #ifndef U_HIDE_INTERNAL_API
2235 
2239  DigitList& _round(const DigitList& number, DigitList& adjustedNum, UBool& isNegative, UErrorCode& status) const;
2240 #endif /* U_HIDE_INTERNAL_API */
2241 
2250  virtual void getEffectiveCurrency(char16_t* result, UErrorCode& ec) const;
2251 
2255  static const int32_t kDoubleIntegerDigits;
2259  static const int32_t kDoubleFractionDigits;
2260 
2271  static const int32_t kMaxScientificIntegerDigits;
2272 
2273 };
2274 
2276 
2277 #endif /* #if !UCONFIG_NO_FORMATTING */
2278 
2279 #endif // _DECIMFMT
2280 //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:88
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.
DecimalFormat is a concrete subclass of NumberFormat that formats decimal numbers.
Definition: decimfmt.h:669
enum bitset for boolean fields.
Definition: enumset.h:33
Abstract base class for all number formats.
Definition: numfmt.h:174
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:2271
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:1069
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:131
UNumberFormatStyle
The possible number format styles.
Definition: unum.h:142
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:396
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:675
A mutable set of Unicode characters and multicharacter strings.
Definition: uniset.h:278
One below the first bitfield-boolean item.
Definition: unum.h:1040
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:132
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: Abstract base class for all number formats.
UNumberFormatAttribute
The possible UNumberFormat numeric attributes.
Definition: unum.h:954
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:2255
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:2259
int8_t UBool
The ICU boolean type.
Definition: umachine.h:236