Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

COleCurrency::Format

Call this member function to create a formatted representation of the currency value.

CString Format( 
   DWORD dwFlags = 0, 
   LCID lcid = LANG_USER_DEFAULT  
) const;
dwFlags

Indicates flags for locale settings. Only the following flag is relevant to currency:

  • LOCALE_NOUSEROVERRIDE   Use the system default locale settings, rather than custom user settings.

lcid

Indicates locale ID to use for the conversion.

A CString that contains the formatted currency value.

It formats the value using the local language specifications (locale IDs). A currency symbol is not included in the value returned. If the status of this COleCurrency object is null, the return value is an empty string. If the status is invalid, the return string is specified by the string resource IDS_INVALID_CURRENCY.

COleCurrency curA;           // value: 0.0000
curA.SetCurrency(4, 500);    // value: 4.0500 

// value returned: 4.05
curA.Format(0, MAKELCID(MAKELANGID(LANG_CHINESE,
   SUBLANG_CHINESE_SINGAPORE), SORT_DEFAULT));
// value returned: 4,05
curA.Format(0, MAKELCID(MAKELANGID(LANG_GERMAN,
   SUBLANG_GERMAN_AUSTRIAN), SORT_DEFAULT));

Header: afxdisp.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.