Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

COleCurrency::operator *=, /=

Allow you to scale this COleCurrency value by an integral value.

const COleCurrency& operator *=( 
   long nOperand  
); 
const COleCurrency& operator /=( 
   long nOperand  
);

If the COleCurrency operand 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 the COleCurrency operand is invalid, 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.

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

// divide in half
cur1 /= 2;
ASSERT(cur1 == COleCurrency(17, 5025));

// multiply by two
cur2 *= 2;
ASSERT(cur2 == COleCurrency(70, 100));

Header: afxdisp.h

Show:
© 2015 Microsoft