共用方式為


COleCurrency 關係運算子

如果條件為 true 時,比較兩個貨幣值並傳回非零,則為 0。

BOOL operator ==(
   const COleCurrency& cur 
) const;
BOOL operator !=(
   const COleCurrency& cur 
) const;
BOOL operator <(
   const COleCurrency& cur 
) const;
BOOL operator >(
   const COleCurrency& cur 
) const;
BOOL operator <=(
   const COleCurrency& cur 
) const;
BOOL operator >=(
   const COleCurrency& cur 
) const;

備註

注意事項注意事項

排序作業 (<<=>>=) 的傳回值為 undefined,如果任一個運算元的狀況是 NULL 或無效。等號比較運算子 (),==!=考慮運算元的狀況。

範例

COleCurrency curOne(3, 5000);             // 3.5
COleCurrency curTwo(curOne);              // 3.5
BOOL b = (curOne == curTwo);              // TRUE

b = curOne < curTwo;                      // FALSE, same value
b = curOne > curTwo;                      // FALSE, same value
b = curOne <= curTwo;                     // TRUE, same value
b = curOne >= curTwo;                     // TRUE, same value
curTwo.SetStatus(COleCurrency::invalid);
b = curOne == curTwo;                     // FALSE, different status
b = curOne != curTwo;                     // TRUE, different status

需求

Header: afxdisp.h

請參閱

參考

COleCurrency 類別

階層架構圖

COleCurrency::GetStatus