Share via


CComCurrency::Round

Call this method to round the currency to a specified number of decimal places.

HRESULT Round( 
   int nDecimals  
);

Parameters

  • nDecimals
    The number of digits to which m_currency will be rounded, in the range 0 to 4.

Return Value

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

Example

CComCurrency cur(10, 1234);
cur.Round(3);
ATLASSERT(cur.GetFraction() == 1230);   

Requirements

Header: atlcur.h

See Also

Reference

CComCurrency Class