Share via


CComCurrency::SetFraction

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

HRESULT SetFraction(
   SHORT nFraction 
);

Parameters

  • nFraction
    The value to be assigned to the fractional component of the m_currency data member. The sign of the fractional component must the same as the integer component, and the value must be in range -9999 (CY_MIN_FRACTION) to +9999 (CY_MAX_FRACTION).

Return Value

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

Example

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

Requirements

Header: atlcur.h

See Also

Reference

CComCurrency Class

CComCurrency::GetFraction

CComCurrency::SetInteger

CComCurrency::SetInteger

Other Resources

CComCurrency Members