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

Measure::Measure ( const Formattable number,
MeasureUnit adoptedUnit,
UErrorCode ec 
)

Construct an object with the given numeric amount and the given unit. After this call, the caller must not delete the given unit object.

Parameters:
number a numeric object; amount.isNumeric() must be TRUE
adoptedUnit the unit object, which must not be NULL
ec input-output error code. If the amount or the unit is invalid, then this will be set to a failing value. ICU 3.0

Definition at line 22 of file measure.cpp.

References Formattable::isNumeric(), number, U_ILLEGAL_ARGUMENT_ERROR, and U_SUCCESS.

                                 :
    number(_number), unit(adoptedUnit) {
    if (U_SUCCESS(ec) &&
        (!number.isNumeric() || adoptedUnit == 0)) {
        ec = U_ILLEGAL_ARGUMENT_ERROR;
    }
}


Generated by  Doxygen 1.6.0   Back to index