Logo Search packages:      
Sourcecode: icu version File versions

Formattable & DecimalFormat::parseCurrency ( const UnicodeString text,
Formattable result,
ParsePosition pos 
) const [virtual]

Parses text from the given string as a currency amount. Unlike the parse() method, this method will attempt to parse a generic currency name, searching for a match of this object's locale's currency display names, or for a 3-letter ISO currency code. This method will fail if this format is not a currency format, that is, if it does not contain the currency pattern symbol (U+00A4) in its prefix or suffix.

textthe string to parse
resultoutput parameter to receive result. This will have its currency set to the parsed ISO currency code.
posinput-output position; on input, the position within text to match; must have 0 <= pos.getIndex() < text.length(); on output, the position after the last matched character. If the parse fails, the position in unchanged upon output.
a reference to result

Reimplemented from NumberFormat.

Definition at line 1568 of file decimfmt.cpp.

References parse(), and TRUE.

    parse(text, result, pos, TRUE);
    return result;

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index