- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- Search for |

- File List
- Globals

# decimfmt.h

Go to the documentation of this file.

    00001 /*
    00002 ********************************************************************************
    00003 *   Copyright (C) 1997-2009, International Business Machines
    00004 *   Corporation and others.  All Rights Reserved.
    00005 ********************************************************************************
    00006 *
    00007 * File DECIMFMT.H
    00008 *
    00009 * Modification History:
    00010 *
    00011 *   Date        Name        Description
    00012 *   02/19/97    aliu        Converted from java.
    00013 *   03/20/97    clhuang     Updated per C++ implementation.
    00014 *   04/03/97    aliu        Rewrote parsing and formatting completely, and
    00015 *                           cleaned up and debugged.  Actually works now.
    00016 *   04/17/97    aliu        Changed DigitCount to int per code review.
    00017 *   07/10/97    helena      Made ParsePosition a class and get rid of the function
    00018 *                           hiding problems.
    00019 *   09/09/97    aliu        Ported over support for exponential formats.
    00020 *    07/20/98    stephen        Changed documentation
    00021 ********************************************************************************
    00022 */
    00023
    00024 #ifndef DECIMFMT_H
    00025 #define DECIMFMT_H
    00026
    00027 #include "unicode/utypes.h"
    00033 #if !UCONFIG_NO_FORMATTING
    00034
    00035 #include "unicode/dcfmtsym.h"
    00036 #include "unicode/numfmt.h"
    00037 #include "unicode/locid.h"
    00038
    00039 union UHashTok;
    00040
    00041 U_NAMESPACE_BEGIN
    00042
    00043 U_CDECL_BEGIN
    00044
    00048 UBool U_CALLCONV decimfmtAffixValueComparator(UHashTok val1, UHashTok val2) ;
    00049
    00053 UBool U_CALLCONV decimfmtAffixPatternValueComparator(UHashTok val1, UHashTok val2) ;
    00054
    00055 U_CDECL_END
    00056
    00057 class DigitList;
    00058 class ChoiceFormat;
    00059 class CurrencyPluralInfo;
    00060 class Hashtable;
    00061
    00650 class U_I18N_API DecimalFormat: public NumberFormat {
    00651 public:
    00656     enum ERoundingMode {
    00657         kRoundCeiling,
    00658         kRoundFloor,
    00659         kRoundDown,
    00660         kRoundUp,
    00661         kRoundHalfEven,
    00663         kRoundHalfDown,
    00665         kRoundHalfUp
    00667         // We don't support ROUND_UNNECESSARY
    00668     };
    00669
    00674     enum EPadPosition {
    00675         kPadBeforePrefix,
    00676         kPadAfterPrefix,
    00677         kPadBeforeSuffix,
    00678         kPadAfterSuffix
    00679     };
    00680
    00694     DecimalFormat(UErrorCode& status);
    00695
    00710     DecimalFormat(const UnicodeString& pattern,
    00711                   UErrorCode& status);
    00712
    00731     DecimalFormat(  const UnicodeString& pattern,
    00732                     DecimalFormatSymbols* symbolsToAdopt,
    00733                     UErrorCode& status);
    00734
    00747     DecimalFormat(  const UnicodeString& pattern,
    00748                     DecimalFormatSymbols* symbolsToAdopt,
    00749                     NumberFormat::EStyles style,
    00750                     UErrorCode& status);
    00751
    00771     DecimalFormat(  const UnicodeString& pattern,
    00772                     DecimalFormatSymbols* symbolsToAdopt,
    00773                     UParseError& parseError,
    00774                     UErrorCode& status);
    00792     DecimalFormat(  const UnicodeString& pattern,
    00793                     const DecimalFormatSymbols& symbols,
    00794                     UErrorCode& status);
    00795
    00802     DecimalFormat(const DecimalFormat& source);
    00803
    00810     DecimalFormat& operator=(const DecimalFormat& rhs);
    00811
    00816     virtual ~DecimalFormat();
    00817
    00825     virtual Format* clone(void) const;
    00826
    00835     virtual UBool operator==(const Format& other) const;
    00836
    00848     virtual UnicodeString& format(double number,
    00849                                   UnicodeString& appendTo,
    00850                                   FieldPosition& pos) const;
    00862     virtual UnicodeString& format(int32_t number,
    00863                                   UnicodeString& appendTo,
    00864                                   FieldPosition& pos) const;
    00876     virtual UnicodeString& format(int64_t number,
    00877                                   UnicodeString& appendTo,
    00878                                   FieldPosition& pos) const;
    00879
    00892     virtual UnicodeString& format(const Formattable& obj,
    00893                                   UnicodeString& appendTo,
    00894                                   FieldPosition& pos,
    00895                                   UErrorCode& status) const;
    00896
    00908     UnicodeString& format(const Formattable& obj,
    00909                           UnicodeString& appendTo,
    00910                           UErrorCode& status) const;
    00911
    00922     UnicodeString& format(double number,
    00923                           UnicodeString& appendTo) const;
    00924
    00936     UnicodeString& format(int32_t number,
    00937                           UnicodeString& appendTo) const;
    00938
    00950     UnicodeString& format(int64_t number,
    00951                           UnicodeString& appendTo) const;
    00971     virtual void parse(const UnicodeString& text,
    00972                        Formattable& result,
    00973                        ParsePosition& parsePosition) const;
    00974
    00975     // Declare here again to get rid of function hiding problems.
    00984     virtual void parse(const UnicodeString& text,
    00985                        Formattable& result,
    00986                        UErrorCode& status) const;
    00987
    01007     virtual Formattable& parseCurrency(const UnicodeString& text,
    01008                                        Formattable& result,
    01009                                        ParsePosition& pos) const;
    01010
    01018     virtual const DecimalFormatSymbols* getDecimalFormatSymbols(void) const;
    01019
    01026     virtual void adoptDecimalFormatSymbols(DecimalFormatSymbols* symbolsToAdopt);
    01027
    01034     virtual void setDecimalFormatSymbols(const DecimalFormatSymbols& symbols);
    01035
    01036
    01043     virtual const CurrencyPluralInfo* getCurrencyPluralInfo(void) const;
    01044
    01051     virtual void adoptCurrencyPluralInfo(CurrencyPluralInfo* toAdopt);
    01052
    01059     virtual void setCurrencyPluralInfo(const CurrencyPluralInfo& info);
    01060
    01061
    01070     UnicodeString& getPositivePrefix(UnicodeString& result) const;
    01071
    01079     virtual void setPositivePrefix(const UnicodeString& newValue);
    01080
    01089     UnicodeString& getNegativePrefix(UnicodeString& result) const;
    01090
    01098     virtual void setNegativePrefix(const UnicodeString& newValue);
    01099
    01108     UnicodeString& getPositiveSuffix(UnicodeString& result) const;
    01109
    01117     virtual void setPositiveSuffix(const UnicodeString& newValue);
    01118
    01127     UnicodeString& getNegativeSuffix(UnicodeString& result) const;
    01128
    01136     virtual void setNegativeSuffix(const UnicodeString& newValue);
    01137
    01148     int32_t getMultiplier(void) const;
    01149
    01160     virtual void setMultiplier(int32_t newValue);
    01161
    01171     virtual double getRoundingIncrement(void) const;
    01172
    01183     virtual void setRoundingIncrement(double newValue);
    01184
    01193     virtual ERoundingMode getRoundingMode(void) const;
    01194
    01204     virtual void setRoundingMode(ERoundingMode roundingMode);
    01205
    01217     virtual int32_t getFormatWidth(void) const;
    01218
    01233     virtual void setFormatWidth(int32_t width);
    01234
    01247     virtual UnicodeString getPadCharacterString() const;
    01248
    01263     virtual void setPadCharacter(const UnicodeString &padChar);
    01264
    01280     virtual EPadPosition getPadPosition(void) const;
    01281
    01298     virtual void setPadPosition(EPadPosition padPos);
    01299
    01310     virtual UBool isScientificNotation(void);
    01311
    01327     virtual void setScientificNotation(UBool useScientific);
    01328
    01339     virtual int8_t getMinimumExponentDigits(void) const;
    01340
    01353     virtual void setMinimumExponentDigits(int8_t minExpDig);
    01354
    01367     virtual UBool isExponentSignAlwaysShown(void);
    01368
    01382     virtual void setExponentSignAlwaysShown(UBool expSignAlways);
    01383
    01395     int32_t getGroupingSize(void) const;
    01396
    01408     virtual void setGroupingSize(int32_t newValue);
    01409
    01428     int32_t getSecondaryGroupingSize(void) const;
    01429
    01441     virtual void setSecondaryGroupingSize(int32_t newValue);
    01442
    01451     UBool isDecimalSeparatorAlwaysShown(void) const;
    01452
    01461     virtual void setDecimalSeparatorAlwaysShown(UBool newValue);
    01462
    01473     virtual UnicodeString& toPattern(UnicodeString& result) const;
    01474
    01485     virtual UnicodeString& toLocalizedPattern(UnicodeString& result) const;
    01486
    01516     virtual void applyPattern(const UnicodeString& pattern,
    01517                              UParseError& parseError,
    01518                              UErrorCode& status);
    01527     virtual void applyPattern(const UnicodeString& pattern,
    01528                              UErrorCode& status);
    01529
    01560     virtual void applyLocalizedPattern(const UnicodeString& pattern,
    01561                                        UParseError& parseError,
    01562                                        UErrorCode& status);
    01563
    01573     virtual void applyLocalizedPattern(const UnicodeString& pattern,
    01574                                        UErrorCode& status);
    01575
    01576
    01586     virtual void setMaximumIntegerDigits(int32_t newValue);
    01587
    01597     virtual void setMinimumIntegerDigits(int32_t newValue);
    01598
    01608     virtual void setMaximumFractionDigits(int32_t newValue);
    01609
    01619     virtual void setMinimumFractionDigits(int32_t newValue);
    01620
    01628     int32_t getMinimumSignificantDigits() const;
    01629
    01637     int32_t getMaximumSignificantDigits() const;
    01638
    01648     void setMinimumSignificantDigits(int32_t min);
    01649
    01660     void setMaximumSignificantDigits(int32_t max);
    01661
    01668     UBool areSignificantDigitsUsed() const;
    01669
    01677     void setSignificantDigitsUsed(UBool useSignificantDigits);
    01678
    01679  public:
    01692     virtual void setCurrency(const UChar* theCurrency, UErrorCode& ec);
    01693
    01699     virtual void setCurrency(const UChar* theCurrency);
    01700
    01706     static const char fgNumberPatterns[];
    01707
    01708 public:
    01709
    01721     static UClassID U_EXPORT2 getStaticClassID(void);
    01722
    01734     virtual UClassID getDynamicClassID(void) const;
    01735
    01736 private:
    01737     friend UBool U_CALLCONV decimfmtAffixValueComparator(UHashTok val1, UHashTok val2);
    01738     friend UBool U_CALLCONV decimfmtAffixPatternValueComparator(UHashTok val1, UHashTok val2);
    01739
    01740     DecimalFormat(); // default constructor not implemented
    01741
    01742     int32_t precision(UBool isIntegral) const;
    01743
    01747     void construct(UErrorCode&               status,
    01748                    UParseError&             parseErr,
    01749                    const UnicodeString*     pattern = 0,
    01750                    DecimalFormatSymbols*    symbolsToAdopt = 0
    01751                    );
    01752
    01761     UnicodeString& toPattern(UnicodeString& result, UBool localized) const;
    01762
    01773     void applyPattern(const UnicodeString& pattern,
    01774                             UBool localized,
    01775                             UParseError& parseError,
    01776                             UErrorCode& status);
    01777
    01778     /*
    01779      * similar to applyPattern, but without re-gen affix for currency
    01780      */
    01781     void applyPatternInternally(const UnicodeString& pluralCount,
    01782                                 const UnicodeString& pattern,
    01783                                 UBool localized,
    01784                                 UParseError& parseError,
    01785                                 UErrorCode& status);
    01786
    01787     /*
    01788      * only apply pattern without expand affixes
    01789      */
    01790     void applyPatternWithoutExpandAffix(const UnicodeString& pattern,
    01791                                         UBool localized,
    01792                                         UParseError& parseError,
    01793                                         UErrorCode& status);
    01794
    01795
    01796     /*
    01797      * expand affixes (after apply patter) and re-compute fFormatWidth
    01798      */
    01799     void expandAffixAdjustWidth(const UnicodeString* pluralCount);
    01800
    01801
    01813     UnicodeString& subformat(UnicodeString& appendTo,
    01814                              FieldPosition& fieldPosition,
    01815                              DigitList& digits,
    01816                              UBool         isInteger) const;
    01817
    01818
    01819     void parse(const UnicodeString& text,
    01820                Formattable& result,
    01821                ParsePosition& pos,
    01822                UBool parseCurrency) const;
    01823
    01824     enum {
    01825         fgStatusInfinite,
    01826         fgStatusLength      // Leave last in list.
    01827     } StatusFlags;
    01828
    01829     UBool subparse(const UnicodeString& text,
    01830                    const UnicodeString* negPrefix,
    01831                    const UnicodeString* negSuffix,
    01832                    const UnicodeString* posPrefix,
    01833                    const UnicodeString* posSuffix,
    01834                    UBool currencyParsing,
    01835                    int8_t type,
    01836                    ParsePosition& parsePosition,
    01837                    DigitList& digits, UBool* status,
    01838                    UChar* currency) const;
    01839
    01840     // Mixed style parsing for currency.
    01841     // It parses against the current currency pattern
    01842     // using complex affix comparison
    01843     // parses against the currency plural patterns using complex affix comparison,
    01844     // and parses against the current pattern using simple affix comparison.
    01845     UBool parseForCurrency(const UnicodeString& text,
    01846                            ParsePosition& parsePosition,
    01847                            DigitList& digits,
    01848                            UBool* status,
    01849                            UChar* currency) const;
    01850
    01851     int32_t skipPadding(const UnicodeString& text, int32_t position) const;
    01852
    01853     int32_t compareAffix(const UnicodeString& input,
    01854                          int32_t pos,
    01855                          UBool isNegative,
    01856                          UBool isPrefix,
    01857                          const UnicodeString* affixPat,
    01858                          UBool currencyParsing,
    01859                          int8_t type,
    01860                          UChar* currency) const;
    01861
    01862     static int32_t compareSimpleAffix(const UnicodeString& affix,
    01863                                       const UnicodeString& input,
    01864                                       int32_t pos);
    01865
    01866     static int32_t skipRuleWhiteSpace(const UnicodeString& text, int32_t pos);
    01867
    01868     static int32_t skipUWhiteSpace(const UnicodeString& text, int32_t pos);
    01869
    01870     int32_t compareComplexAffix(const UnicodeString& affixPat,
    01871                                 const UnicodeString& input,
    01872                                 int32_t pos,
    01873                                 int8_t type,
    01874                                 UChar* currency) const;
    01875
    01876     static int32_t match(const UnicodeString& text, int32_t pos, UChar32 ch);
    01877
    01878     static int32_t match(const UnicodeString& text, int32_t pos, const UnicodeString& str);
    01879
    01885     inline const UnicodeString &getConstSymbol(DecimalFormatSymbols::ENumberFormatSymbol symbol) const;
    01886
    01887     int32_t appendAffix(UnicodeString& buf, double number,
    01888                         UBool isNegative, UBool isPrefix) const;
    01889
    01895     void appendAffixPattern(UnicodeString& appendTo, const UnicodeString& affix,
    01896                             UBool localized) const;
    01897
    01898     void appendAffixPattern(UnicodeString& appendTo,
    01899                             const UnicodeString* affixPattern,
    01900                             const UnicodeString& expAffix, UBool localized) const;
    01901
    01902     void expandAffix(const UnicodeString& pattern,
    01903                      UnicodeString& affix,
    01904                      double number,
    01905                      UBool doFormat,
    01906                      const UnicodeString* pluralCount) const;
    01907
    01908     void expandAffixes(const UnicodeString* pluralCount);
    01909
    01910     static double round(double a, ERoundingMode mode, UBool isNegative);
    01911
    01912     void addPadding(UnicodeString& appendTo,
    01913                     FieldPosition& fieldPosition,
    01914                     int32_t prefixLen, int32_t suffixLen) const;
    01915
    01916     UBool isGroupingPosition(int32_t pos) const;
    01917
    01918     void setCurrencyForSymbols();
    01919
    01920     // similar to setCurrency without re-compute the affixes for currency.
    01921     // If currency changes, the affix pattern for currency is not changed,
    01922     // but the affix will be changed. So, affixes need to be
    01923     // re-computed in setCurrency(), but not in setCurrencyInternally().
    01924     virtual void setCurrencyInternally(const UChar* theCurrency, UErrorCode& ec);
    01925
    01926     // set up currency affix patterns for mix parsing.
    01927     // The patterns saved here are the affix patterns of default currency
    01928     // pattern and the unique affix patterns of the plural currency patterns.
    01929     // Those patterns are used by parseForCurrency().
    01930     void setupCurrencyAffixPatterns(UErrorCode& status);
    01931
    01932     // set up the currency affixes used in currency plural formatting.
    01933     // It sets up both fAffixesForCurrency for currency pattern if the current
    01934     // pattern contains 3 currency signs,
    01935     // and it sets up fPluralAffixesForCurrency for currency plural patterns.
    01936     void setupCurrencyAffixes(const UnicodeString& pattern,
    01937                               UBool setupForCurrentPattern,
    01938                               UBool setupForPluralPattern,
    01939                               UErrorCode& status);
    01940
    01941     // hashtable operations
    01942     Hashtable* initHashForAffixPattern(UErrorCode& status);
    01943     Hashtable* initHashForAffix(UErrorCode& status);
    01944
    01945     void deleteHashForAffixPattern();
    01946     void deleteHashForAffix(Hashtable*& table);
    01947
    01948     void copyHashForAffixPattern(const Hashtable* source,
    01949                                  Hashtable* target, UErrorCode& status);
    01950     void copyHashForAffix(const Hashtable* source,
    01951                           Hashtable* target, UErrorCode& status);
    01952
    01953     // currency sign count
    01954     enum {
    01955         fgCurrencySignCountZero,
    01956         fgCurrencySignCountInSymbolFormat,
    01957         fgCurrencySignCountInISOFormat,
    01958         fgCurrencySignCountInPluralFormat
    01959     } CurrencySignCount;
    01960
    01964     //static const int8_t fgMaxDigit; // The largest digit, in this case 9
    01965
    01966     /*transient*/ //DigitList* fDigitList;
    01967
    01968     UnicodeString           fPositivePrefix;
    01969     UnicodeString           fPositiveSuffix;
    01970     UnicodeString           fNegativePrefix;
    01971     UnicodeString           fNegativeSuffix;
    01972     UnicodeString*          fPosPrefixPattern;
    01973     UnicodeString*          fPosSuffixPattern;
    01974     UnicodeString*          fNegPrefixPattern;
    01975     UnicodeString*          fNegSuffixPattern;
    01976
    01982     ChoiceFormat*           fCurrencyChoice;
    01983
    01984     int32_t                 fMultiplier;
    01985     int32_t                 fGroupingSize;
    01986     int32_t                 fGroupingSize2;
    01987     UBool                   fDecimalSeparatorAlwaysShown;
    01988     DecimalFormatSymbols*   fSymbols;
    01989
    01990     UBool                   fUseSignificantDigits;
    01991     int32_t                 fMinSignificantDigits;
    01992     int32_t                 fMaxSignificantDigits;
    01993
    01994     UBool                   fUseExponentialNotation;
    01995     int8_t                  fMinExponentDigits;
    01996     UBool                   fExponentSignAlwaysShown;
    01997
    01998     /* If fRoundingIncrement is NULL, there is no rounding.  Otherwise, round to
    01999      * fRoundingIncrement.getDouble().  Since this operation may be expensive,
    02000      * we cache the result in fRoundingDouble.  All methods that update
    02001      * fRoundingIncrement also update fRoundingDouble. */
    02002     DigitList*              fRoundingIncrement;
    02003     /*transient*/ double    fRoundingDouble;
    02004     ERoundingMode           fRoundingMode;
    02005
    02006     UChar32                 fPad;
    02007     int32_t                 fFormatWidth;
    02008     EPadPosition            fPadPosition;
    02009
    02010     /*
    02011      * Following are used for currency format
    02012      */
    02013     // pattern used in this formatter
    02014     UnicodeString fFormatPattern;
    02015     // style is only valid when decimal formatter is constructed by
    02016     // DecimalFormat(pattern, decimalFormatSymbol, style)
    02017     int fStyle;
    02018     /*
    02019      * Represents whether this is a currency format, and which
    02020      * currency format style.
    02021      * 0: not currency format type;
    02022      * 1: currency style -- symbol name, such as "$" for US dollar.
    02023      * 2: currency style -- ISO name, such as USD for US dollar.
    02024      * 3: currency style -- plural long name, such as "US Dollar" for
    02025      *                      "1.00 US Dollar", or "US Dollars" for
    02026      *                      "3.00 US Dollars".
    02027      */
    02028     int fCurrencySignCount;
    02029
    02030
    02031     /* For currency parsing purose,
    02032      * Need to remember all prefix patterns and suffix patterns of
    02033      * every currency format pattern,
    02034      * including the pattern of default currecny style
    02035      * and plural currency style. And the patterns are set through applyPattern.
    02036      */
    02037     // TODO: innerclass?
    02038     struct AffixPatternsForCurrency : public UMemory {
    02039         // negative prefix pattern
    02040         UnicodeString negPrefixPatternForCurrency;
    02041         // negative suffix pattern
    02042         UnicodeString negSuffixPatternForCurrency;
    02043         // positive prefix pattern
    02044         UnicodeString posPrefixPatternForCurrency;
    02045         // positive suffix pattern
    02046         UnicodeString posSuffixPatternForCurrency;
    02047         int8_t patternType;
    02048
    02049         AffixPatternsForCurrency(const UnicodeString& negPrefix,
    02050                                  const UnicodeString& negSuffix,
    02051                                  const UnicodeString& posPrefix,
    02052                                  const UnicodeString& posSuffix,
    02053                                  int8_t type) {
    02054             negPrefixPatternForCurrency = negPrefix;
    02055             negSuffixPatternForCurrency = negSuffix;
    02056             posPrefixPatternForCurrency = posPrefix;
    02057             posSuffixPatternForCurrency = posSuffix;
    02058             patternType = type;
    02059         }
    02060     };
    02061
    02062     /* affix for currency formatting when the currency sign in the pattern
    02063      * equals to 3, such as the pattern contains 3 currency sign or
    02064      * the formatter style is currency plural format style.
    02065      */
    02066     struct AffixesForCurrency : public UMemory {
    02067         // negative prefix
    02068         UnicodeString negPrefixForCurrency;
    02069         // negative suffix
    02070         UnicodeString negSuffixForCurrency;
    02071         // positive prefix
    02072         UnicodeString posPrefixForCurrency;
    02073         // positive suffix
    02074         UnicodeString posSuffixForCurrency;
    02075
    02076         int32_t formatWidth;
    02077
    02078         AffixesForCurrency(const UnicodeString& negPrefix,
    02079                            const UnicodeString& negSuffix,
    02080                            const UnicodeString& posPrefix,
    02081                            const UnicodeString& posSuffix) {
    02082             negPrefixForCurrency = negPrefix;
    02083             negSuffixForCurrency = negSuffix;
    02084             posPrefixForCurrency = posPrefix;
    02085             posSuffixForCurrency = posSuffix;
    02086         }
    02087     };
    02088
    02089     // Affix pattern set for currency.
    02090     // It is a set of AffixPatternsForCurrency,
    02091     // each element of the set saves the negative prefix pattern,
    02092     // negative suffix pattern, positive prefix pattern,
    02093     // and positive suffix  pattern of a pattern.
    02094     // It is used for currency mixed style parsing.
    02095     // It is actually is a set.
    02096     // The set contains the default currency pattern from the locale,
    02097     // and the currency plural patterns.
    02098     // Since it is a set, it does not contain duplicated items.
    02099     // For example, if 2 currency plural patterns are the same, only one pattern
    02100     // is included in the set. When parsing, we do not check whether the plural
    02101     // count match or not.
    02102     Hashtable* fAffixPatternsForCurrency;
    02103
    02104     // Following 2 are affixes for currency.
    02105     // It is a hash map from plural count to AffixesForCurrency.
    02106     // AffixesForCurrency saves the negative prefix,
    02107     // negative suffix, positive prefix, and positive suffix of a pattern.
    02108     // It is used during currency formatting only when the currency sign count
    02109     // is 3. In which case, the affixes are getting from here, not
    02110     // from the fNegativePrefix etc.
    02111     Hashtable* fAffixesForCurrency;  // for current pattern
    02112     Hashtable* fPluralAffixesForCurrency;  // for plural pattern
    02113
    02114     // Information needed for DecimalFormat to format/parse currency plural.
    02115     CurrencyPluralInfo* fCurrencyPluralInfo;
    02116
    02117 protected:
    02118
    02127     virtual void getEffectiveCurrency(UChar* result, UErrorCode& ec) const;
    02128
    02132     static const int32_t  kDoubleIntegerDigits;
    02136     static const int32_t  kDoubleFractionDigits;
    02137
    02148     static const int32_t  kMaxScientificIntegerDigits;
    02149 };
    02150
    02151 inline UnicodeString&
    02152 DecimalFormat::format(const Formattable& obj,
    02153                       UnicodeString& appendTo,
    02154                       UErrorCode& status) const {
    02155     // Don't use Format:: - use immediate base class only,
    02156     // in case immediate base modifies behavior later.
    02157     return NumberFormat::format(obj, appendTo, status);
    02158 }
    02159
    02160 inline UnicodeString&
    02161 DecimalFormat::format(double number,
    02162                       UnicodeString& appendTo) const {
    02163     FieldPosition pos(0);
    02164     return format(number, appendTo, pos);
    02165 }
    02166
    02167 inline UnicodeString&
    02168 DecimalFormat::format(int32_t number,
    02169                       UnicodeString& appendTo) const {
    02170     FieldPosition pos(0);
    02171     return format((int64_t)number, appendTo, pos);
    02172 }
    02173
    02174 inline const UnicodeString &
    02175 DecimalFormat::getConstSymbol(DecimalFormatSymbols::ENumberFormatSymbol symbol) const {
    02176     return fSymbols->getConstSymbol(symbol);
    02177 }
    02178
    02179 U_NAMESPACE_END
    02180
    02181 #endif /* #if !UCONFIG_NO_FORMATTING */
    02182
    02183 #endif // _DECIMFMT
    02184 //eof