COleCurrency::operator +=, -=

Allow you to add and subtract a COleCurrency value to and from this COleCurrency object.

const COleCurrency& operator +=(
   const COleCurrency& cur 
);
const COleCurrency& operator -=(
   const COleCurrency& cur 
);

Remarks

If either of the operands is null, the status of this COleCurrency object is set to null.

If the arithmetic operation overflows, the status of this COleCurrency object is set to invalid.

If either of the operands is invalid and the other is not null, the status of this COleCurrency object is set to invalid.

For more information on the valid, invalid, and null status values, see the m_status member variable.

Example

// both set to 35.0050
COleCurrency cur1(35, 50);
COleCurrency cur2(35, 50);

// adding 2.0075 results in 37.0125
cur1 += COleCurrency(2, 75);
ASSERT(cur1 == COleCurrency(37, 125));

// subtracting 2.0075 results in 32.9975
cur2 -= COleCurrency(2, 75);
ASSERT(cur2 == COleCurrency(32, 9975));

Requirements

Header: afxdisp.h

See Also

Reference

COleCurrency Class

Hierarchy Chart

COleCurrency::operator +, -

COleCurrency::GetStatus

Other Resources

COleCurrency Members