This topic has not yet been rated - Rate this topic

COleCurrency::operator *, /

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

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

If the COleCurrency operand is null, the status of the resulting COleCurrency value is null.

If the arithmetic operation overflows or underflows, the status of the resulting COleCurrency value is invalid.

If the COleCurrency operand is invalid, the status of the resulting COleCurrency value is invalid.

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

// 35 units and 50/10000, or 35.0050
COleCurrency cur1(35, 50);
COleCurrency cur2;

// divided by two is 17.5025
cur2 = cur1 / 2;
ASSERT(cur2 == COleCurrency(17, 5025));

// multiplied by two is 70.0100
cur2 = cur1 * 2;
ASSERT(cur2 == COleCurrency(70, 100));

Header: afxdisp.h

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.