COleCurrency Class

Encapsulates the CURRENCY data type of OLE automation.

class COleCurrency

Members

Public Constructors

Name

Description

COleCurrency::COleCurrency

Constructs a COleCurrency object.

Public Methods

Name

Description

COleCurrency::Format

Generates a formatted string representation of a COleCurrency object.

COleCurrency::GetStatus

Gets the status (validity) of this COleCurrency object.

COleCurrency::ParseCurrency

Reads a CURRENCY value from a string and sets the value of COleCurrency.

COleCurrency::SetCurrency

Sets the value of this COleCurrency object.

COleCurrency::SetStatus

Sets the status (validity) for this COleCurrency object.

Public Operators

Name

Description

operator =

Copies a COleCurrency value.

operator +, -

Adds, subtracts, and changes sign of COleCurrency values.

operator +=, -=

Adds and subtracts a COleCurrency value from this COleCurrency object.

operator *, /

Scales a COleCurrency value by an integer value.

operator *=, /=

Scales this COleCurrency value by an integer value.

operator <<

Outputs a COleCurrency value to CArchive or CDumpContext.

operator >>

Inputs a COleCurrency object from CArchive.

operator CURRENCY

Converts a COleCurrency value into a CURRENCY.

operator ==, <, <=, etc.

Compares two COleCurrency values.

Public Data Members

Name

Description

COleCurrency::m_cur

Contains the underlying CURRENCY for this COleCurrency object.

COleCurrency::m_status

Contains the status of this COleCurrency object.

Remarks

COleCurrency does not have a base class.

CURRENCY is implemented as an 8-byte, two's-complement integer value scaled by 10,000. This gives a fixed-point number with 15 digits to the left of the decimal point and 4 digits to the right. The CURRENCY data type is extremely useful for calculations involving money, or for any fixed-point calculation where accuracy is important. It is one of the possible types for the VARIANT data type of OLE automation.

COleCurrency also implements some basic arithmetic operations for this fixed-point type. The supported operations have been selected to control the rounding errors which occur during fixed-point calculations.

Inheritance Hierarchy

COleCurrency

Requirements

Header: afxdisp.h

See Also

Reference

Hierarchy Chart

COleVariant Class