Share via


IEuroDisplay::FormatBaseMoney Method [C++]

Use this method to create a string representation of a currency Variant, based on the base locale identifier and the base currency symbol string.

Definition

[C++]

HRESULT IEuroDisplay::FormatBaseMoney(VARIANTvtConvMoney,
  BSTR*szBaseMoney);

[Visual Basic]

Function FormatBaseMoney(vtConvMoney As Variant) As String

Parameters

  • vtConvMoney[C++]
    [in] A currency VARIANT that contains the monetary value to convert.
  • vtConvMoney[Visual Basic]
    A currency Variant that contains the monetary value to convert.
  • szBaseMoney[C++]
    [out, retval] A BSTR used to return the string representation of the specified currency VARIANT.

Return Values

[C++] This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

[Visual Basic] If this method completes successfully, it returns a String that contains the string representation of the specified currency Variant.

Error Values

[C++] This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.

[Visual Basic] This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

[C++] The szBaseMoney parameter contains valid data only if the method returns successfully.

The correct display of decimal places is dependent upon registry settings. For example, to ensure that 2 decimal places are displayed as in $ 1.08, in the Registry editor, you must ensure that the HKEY_USERS\DEFAULT\Control Panel\International\iCurrDigits value is set to 2.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

[Visual Basic]

Example

' oEuroDisp is a Commerce.EuroDisplay object
' vTest is a Currency Variant
' vResult is a String
vTest = "$ 40.08"
vResult = oEuroDisp.FormatBaseMoney (vTest)
' In the preceding example, if the Base Currency symbol string
' is "$" and the Base locale identifier is 1033, vResult will 
' contain the string, "$ 40.08"

See Also

[C++]EuroDisplay Object

[C++]IEuroDisplay::ConvertBaseStringToCurr

[C++]IEuroDisplay::FormatAltMoney

[Visual Basic]EuroDisplay Object

[Visual Basic]EuroDisplay.ConvertBaseStringToCurr

[Visual Basic]EuroDisplay.FormatAltMoney

Copyright © 2005 Microsoft Corporation.
All rights reserved.