Logo Search packages:      
Sourcecode: icu version File versions

UnicodeString & DecimalFormat::format ( const StringPiece number,
UnicodeString appendTo,
FieldPositionIterator posIter,
UErrorCode status 
) const [virtual]

Format a decimal number. The syntax of the unformatted number is a "numeric string" as defined in the Decimal Arithmetic Specification, available at http://speleotrove.com/decimal

Parameters:
numberThe unformatted number, as a string.
appendToOutput parameter to receive result. Result is appended to existing contents.
posIterOn return, can be used to iterate over positions of fields generated by this format call. Can be NULL.
statusOutput param filled with success/failure status.
Returns:
Reference to 'appendTo' parameter. 4.4

Reimplemented from NumberFormat.

Definition at line 1023 of file decimfmt.cpp.

References DigitList::set(), and U_FAILURE.

{
    DigitList   dnum;
    dnum.set(number, status);
    if (U_FAILURE(status)) {
        return toAppendTo;
    }
    FieldPositionIteratorHandler handler(posIter, status);
    _format(dnum, toAppendTo, handler, status);
    return toAppendTo;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index