Logo Search packages:      
Sourcecode: icu version File versions  Download package

void NumberFormat::getEffectiveCurrency ( UChar *  result,
UErrorCode ec 
) const [protected, virtual, inherited]

Returns the currency in effect for this formatter. Subclasses should override this method as needed. Unlike getCurrency(), this method should never return "".

Returns:
output parameter for null-terminated result, which must have a capacity of at least 4

For internal use only.

Reimplemented in DecimalFormat.

Definition at line 1022 of file numfmt.cpp.

References NumberFormat::getCurrency(), Format::getLocaleID(), NULL, and ULOC_VALID_LOCALE.

Referenced by NumberFormat::parseCurrency().

                                                                           {
    const UChar* c = getCurrency();
    if (*c != 0) {
        u_strncpy(result, c, 3);
        result[3] = 0;
    } else {
        const char* loc = getLocaleID(ULOC_VALID_LOCALE, ec);
        if (loc == NULL) {
            loc = uloc_getDefault();
        }
        ucurr_forLocale(loc, result, 4, &ec);
    }
}


Generated by  Doxygen 1.6.0   Back to index