34 #if !UCONFIG_NO_FORMATTING
48 #if UCONFIG_FORMAT_FASTPATHS_49
49 #define UNUM_DECIMALFORMAT_INTERNAL_SIZE 16
56 class CurrencyPluralInfo;
59 class FieldPositionHandler;
60 class DecimalFormatStaticSets;
64 #if defined (_MSC_VER)
752 #ifndef U_HIDE_INTERNAL_API
770 #if UCONFIG_HAVE_PARSEALLINPUT
774 void setParseAllInput(UNumberFormatAttributeValue value);
1250 virtual void setPositivePrefix(
const UnicodeString& newValue);
1269 virtual void setNegativePrefix(
const UnicodeString& newValue);
1288 virtual void setPositiveSuffix(
const UnicodeString& newValue);
1307 virtual void setNegativeSuffix(
const UnicodeString& newValue);
1319 int32_t getMultiplier(
void)
const;
1331 virtual void setMultiplier(int32_t newValue);
1342 virtual double getRoundingIncrement(
void)
const;
1355 virtual void setRoundingIncrement(
double newValue);
1365 virtual ERoundingMode getRoundingMode(
void)
const;
1375 virtual void setRoundingMode(ERoundingMode roundingMode);
1388 virtual int32_t getFormatWidth(
void)
const;
1404 virtual void setFormatWidth(int32_t width);
1451 virtual EPadPosition getPadPosition(
void)
const;
1469 virtual void setPadPosition(EPadPosition padPos);
1481 virtual UBool isScientificNotation(
void)
const;
1498 virtual void setScientificNotation(
UBool useScientific);
1510 virtual int8_t getMinimumExponentDigits(
void)
const;
1524 virtual void setMinimumExponentDigits(int8_t minExpDig);
1538 virtual UBool isExponentSignAlwaysShown(
void)
const;
1553 virtual void setExponentSignAlwaysShown(
UBool expSignAlways);
1566 int32_t getGroupingSize(
void)
const;
1579 virtual void setGroupingSize(int32_t newValue);
1599 int32_t getSecondaryGroupingSize(
void)
const;
1612 virtual void setSecondaryGroupingSize(int32_t newValue);
1622 UBool isDecimalSeparatorAlwaysShown(
void)
const;
1632 virtual void setDecimalSeparatorAlwaysShown(
UBool newValue);
1634 #ifndef U_HIDE_DRAFT_API
1641 UBool isDecimalPatternMatchRequired(
void)
const;
1653 virtual void setDecimalPatternMatchRequired(
UBool newValue);
1753 virtual void applyLocalizedPattern(
const UnicodeString& pattern,
1766 virtual void applyLocalizedPattern(
const UnicodeString& pattern,
1821 int32_t getMinimumSignificantDigits()
const;
1830 int32_t getMaximumSignificantDigits()
const;
1843 void setMinimumSignificantDigits(int32_t min);
1856 void setMaximumSignificantDigits(int32_t max);
1864 UBool areSignificantDigitsUsed()
const;
1873 void setSignificantDigitsUsed(
UBool useSignificantDigits);
1897 #ifndef U_HIDE_DRAFT_API
1915 #ifndef U_HIDE_DEPRECATED_API
1921 static const char fgNumberPatterns[];
1924 #ifndef U_HIDE_INTERNAL_API
1931 FixedDecimal getFixedDecimal(
double number,
UErrorCode &status)
const;
1947 FixedDecimal getFixedDecimal(DigitList &number,
UErrorCode &status)
const;
1982 int32_t precision()
const;
2027 void applyPatternInternally(
const UnicodeString& pluralCount,
2036 void applyPatternWithoutExpandAffix(
const UnicodeString& pattern,
2045 void expandAffixAdjustWidth(
const UnicodeString* pluralCount);
2059 FieldPositionHandler& handler,
2068 UChar* currency)
const;
2080 UBool complexCurrencyParsing,
2083 DigitList& digits,
UBool* status,
2084 UChar* currency)
const;
2095 UChar* currency)
const;
2097 int32_t skipPadding(
const UnicodeString& text, int32_t position)
const;
2104 UBool complexCurrencyParsing,
2106 UChar* currency)
const;
2115 UBool lenient)
const;
2117 static int32_t skipPatternWhiteSpace(
const UnicodeString& text, int32_t pos);
2119 static int32_t skipUWhiteSpace(
const UnicodeString& text, int32_t pos);
2121 static int32_t skipUWhiteSpaceAndMarks(
const UnicodeString& text, int32_t pos);
2123 static int32_t skipBidiMarks(
const UnicodeString& text, int32_t pos);
2129 UChar* currency)
const;
2157 FieldPositionHandler& handler,
2159 UBool isPrefix)
const;
2167 UBool localized)
const;
2176 FieldPositionHandler& handler,
2183 FieldPositionHandler& handler,
2184 int32_t prefixLen, int32_t suffixLen)
const;
2186 UBool isGroupingPosition(int32_t pos)
const;
2188 void setCurrencyForSymbols();
2194 virtual void setCurrencyInternally(
const UChar* theCurrency,
UErrorCode& ec);
2200 void setupCurrencyAffixPatterns(
UErrorCode& status);
2207 UBool setupForCurrentPattern,
2208 UBool setupForPluralPattern,
2212 double getCurrencyRounding(
const UChar* currency,
2216 int getCurrencyFractionDigits(
const UChar* currency,
2220 Hashtable* initHashForAffixPattern(
UErrorCode& status);
2221 Hashtable* initHashForAffix(
UErrorCode& status);
2223 void deleteHashForAffixPattern();
2224 void deleteHashForAffix(Hashtable*& table);
2226 void copyHashForAffixPattern(
const Hashtable* source,
2228 void copyHashForAffix(
const Hashtable* source,
2233 FieldPositionHandler& handler,
2237 FieldPositionHandler& handler,
2241 FieldPositionHandler& handler,
2264 DigitList * fMultiplier;
2266 int32_t fGroupingSize;
2267 int32_t fGroupingSize2;
2268 UBool fDecimalSeparatorAlwaysShown;
2271 UBool fUseSignificantDigits;
2272 int32_t fMinSignificantDigits;
2273 int32_t fMaxSignificantDigits;
2275 UBool fUseExponentialNotation;
2276 int8_t fMinExponentDigits;
2277 UBool fExponentSignAlwaysShown;
2284 DigitList* fRoundingIncrement;
2285 ERoundingMode fRoundingMode;
2288 int32_t fFormatWidth;
2289 EPadPosition fPadPosition;
2309 int fCurrencySignCount;
2387 Hashtable* fAffixPatternsForCurrency;
2396 Hashtable* fAffixesForCurrency;
2397 Hashtable* fPluralAffixesForCurrency;
2402 #if UCONFIG_HAVE_PARSEALLINPUT
2403 UNumberFormatAttributeValue fParseAllInput;
2407 const DecimalFormatStaticSets *fStaticSets;
2414 #ifndef U_HIDE_INTERNAL_API
2419 DigitList& _round(
const DigitList& number, DigitList& adjustedNum,
UBool& isNegative,
UErrorCode& status)
const;
2453 #if UCONFIG_FORMAT_FASTPATHS_49
2459 uint8_t fReserved[UNUM_DECIMALFORMAT_INTERNAL_SIZE];
2465 void handleChanged();
2471 return fSymbols->getConstSymbol(symbol);
enum bitset for boolean fields.
C++ API: FieldPosition Iterator.
UDisplayContext
Display context settings.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Limit of boolean attributes.
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside...
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.
UNumberFormatStyle
The possible number format styles.
FieldPositionIterator returns the field ids and their start/limit positions generated by a call to Fo...
UCurrencyUsage
Currency Usage used for Decimal Format.
int32_t UChar32
Define UChar32 as a type for single Unicode code points.
A mutable set of Unicode characters and multicharacter strings.
One below the first bitfield-boolean item.
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
FieldPosition is a simple class used by Format and its subclasses to identify fields in formatted out...
C++ API: Symbols for formatting numbers.
ParsePosition is a simple class used by Format and its subclasses to keep track of the current positi...
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".
A UParseError struct is used to returned detailed information about parsing errors.
Basic definitions for ICU, for both C and C++ APIs.
UnicodeString is a string class that stores Unicode characters directly and provides similar function...
C++: internal template EnumSet<>
C++ API: Abstract base class for all number formats.
UNumberFormatAttribute
The possible UNumberFormat numeric attributes.
A string-like object that points to a sized piece of memory.
A currency together with a numeric amount, such as 200 USD.
int8_t UBool
The ICU boolean type.