Share via


CComCurrency::SetInteger

Call this method to set the integer component of a CComCurrency object.

HRESULT SetInteger( 
   LONGLONG nInteger  
);

Parameters

  • nInteger
    The value to be assigned to the integer component of the m_currency data member. The sign of the integer component must match the sign of the existing fractional component.

    nInteger must be in the range CY_MIN_INTEGER to CY_MAX_INTEGER inclusive. These values are defined in atlcur.h.

Return Value

Returns S_OK on success, or an error HRESULT on failure.

Example

CComCurrency cur(0, 5000);
cur.SetInteger(10);
ATLASSERT(CComCurrency(10, 5000) == cur);   

Requirements

Header: atlcur.h

See Also

Reference

CComCurrency Class

CComCurrency::GetInteger

CComCurrency::GetFraction

CComCurrency::SetFraction

Other Resources

CComCurrency Members