|
ICU 76.1 76.1
|
A currency together with a numeric amount, such as 200 USD. More...
#include <curramt.h>
Public Member Functions | |
| CurrencyAmount (const Formattable &amount, ConstChar16Ptr isoCode, UErrorCode &ec) | |
| Construct an object with the given numeric amount and the given ISO currency code. | |
| CurrencyAmount (double amount, ConstChar16Ptr isoCode, UErrorCode &ec) | |
| Construct an object with the given numeric amount and the given ISO currency code. | |
| CurrencyAmount (const CurrencyAmount &other) | |
| Copy constructor. | |
| CurrencyAmount & | operator= (const CurrencyAmount &other) |
| Assignment operator. | |
| virtual CurrencyAmount * | clone () const override |
| Return a polymorphic clone of this object. | |
| virtual | ~CurrencyAmount () |
| Destructor. | |
| virtual UClassID | getDynamicClassID () const override |
| Returns a unique class ID for this object POLYMORPHICALLY. | |
| const CurrencyUnit & | getCurrency () const |
| Return the currency unit object of this object. | |
| const char16_t * | getISOCurrency () const |
| Return the ISO currency code of this object. | |
Public Member Functions inherited from icu::Measure | |
| Measure (const Formattable &number, MeasureUnit *adoptedUnit, UErrorCode &ec) | |
| Construct an object with the given numeric amount and the given unit. | |
| Measure (const Measure &other) | |
| Copy constructor. | |
| Measure & | operator= (const Measure &other) |
| Assignment operator. | |
| virtual | ~Measure () |
| Destructor. | |
| bool | operator== (const UObject &other) const |
| Equality operator. | |
| bool | operator!= (const UObject &other) const |
| Inequality operator. | |
| const Formattable & | getNumber () const |
| Return a reference to the numeric value of this object. | |
| const MeasureUnit & | getUnit () const |
| Return a reference to the unit of this object. | |
Public Member Functions inherited from icu::UObject | |
| virtual | ~UObject () |
| Destructor. | |
Static Public Member Functions | |
| static UClassID | getStaticClassID () |
| Returns the class ID for this class. | |
Static Public Member Functions inherited from icu::Measure | |
| static UClassID | getStaticClassID () |
| Return the class ID for this class. | |
Additional Inherited Members | |
Protected Member Functions inherited from icu::Measure | |
| Measure () | |
| Default constructor. | |
A currency together with a numeric amount, such as 200 USD.
| icu::CurrencyAmount::CurrencyAmount | ( | const Formattable & | amount, |
| ConstChar16Ptr | isoCode, | ||
| UErrorCode & | ec | ||
| ) |
Construct an object with the given numeric amount and the given ISO currency code.
| amount | a numeric object; amount.isNumeric() must be true |
| isoCode | the 3-letter ISO 4217 currency code; must not be nullptr and must have length 3 |
| ec | input-output error code. If the amount or the isoCode is invalid, then this will be set to a failing value. |
| icu::CurrencyAmount::CurrencyAmount | ( | double | amount, |
| ConstChar16Ptr | isoCode, | ||
| UErrorCode & | ec | ||
| ) |
Construct an object with the given numeric amount and the given ISO currency code.
| amount | the amount of the given currency |
| isoCode | the 3-letter ISO 4217 currency code; must not be nullptr and must have length 3 |
| ec | input-output error code. If the isoCode is invalid, then this will be set to a failing value. |
| icu::CurrencyAmount::CurrencyAmount | ( | const CurrencyAmount & | other | ) |
Copy constructor.
|
overridevirtual |
Return a polymorphic clone of this object.
The result will have the same class as returned by getDynamicClassID().
Reimplemented from icu::Measure.
| const CurrencyUnit & icu::CurrencyAmount::getCurrency | ( | ) | const |
Return the currency unit object of this object.
Returns a unique class ID for this object POLYMORPHICALLY.
This method implements a simple form of RTTI used by ICU.
Reimplemented from icu::Measure.
Returns the class ID for this class.
This is used to compare to the return value of getDynamicClassID().
| CurrencyAmount & icu::CurrencyAmount::operator= | ( | const CurrencyAmount & | other | ) |
Assignment operator.