Logo Search packages:      
Sourcecode: icu version File versions

void DecimalFormat::setCurrency ( const UChar theCurrency,
UErrorCode ec 
) [virtual]

Sets the currency used to display currency amounts. This takes effect immediately, if this format is a currency format. If this format is not a currency format, then the currency is used if and when this object becomes a currency format through the application of a new pattern.

theCurrencya 3-letter ISO code indicating new currency to use. It need not be null-terminated. May be the empty string or NULL to indicate no currency.
ecinput-output error code ICU 3.0

Reimplemented from NumberFormat.

Definition at line 4644 of file decimfmt.cpp.

References applyPattern(), FALSE, and UnicodeString::indexOf().

Referenced by setCurrency(), NumberFormatRegressionTest::Test4212072(), and unum_setTextAttribute().

    // set the currency before compute affixes to get the right currency names
    NumberFormat::setCurrency(theCurrency, ec);
    if (fFormatPattern.indexOf(fgTripleCurrencySign, 3, 0) != -1) {
        UnicodeString savedPtn = fFormatPattern;
        setupCurrencyAffixes(fFormatPattern, TRUE, TRUE, ec);
        UParseError parseErr;
        applyPattern(savedPtn, FALSE, parseErr, ec);
    // set the currency after apply pattern to get the correct rounding/fraction
    setCurrencyInternally(theCurrency, ec);

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index