Share via


DataFunctions.LocalizeCurrency Method (PIA)

Use this method to retrieve a string representation of a currency value formatted to a specified locale and currency symbol.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop
…
Public Function LocalizeCurrency(cyCurrency As Object,
 Optional vtLocale As Object,
 Optional vtCurrencySymbol As Object) As Object

[C#]

using Microsoft.CommerceServer.Interop;
…
public object LocalizeCurrency(objectcyCurrency,
 objectvtLocale,
 objectvtCurrencySymbol);

Parameters

[Visual Basic .NET]

  • cyCurrency
    A currency Object that contains the value to format as a string.
  • vtLocale
    An Object that contains the locale to use when formatting the string.
  • vtCurrencySymbol
    An Object that contains the currency symbol to use when formatting the string.

[C#]

  • cyCurrency
    A currency object that contains the value to format as a string.
  • vtLocale
    An object that contains the locale to use when formatting the string. If you want the value of the Locale property of the DataFunctions object to be used, pass Type.Missing for this parameter.
  • vtCurrencySymbol
    An object that contains the currency symbol to use when formatting the string. If you want the value of the CurrencySymbol property of the DataFunctions object to be used, pass Type.Missing for this parameter.

Return Values

[Visual Basic .NET] If this method completes successfully, it returns an Object containing the formatted string.

[C#] This method returns an object containing the string representation of the currency value.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

Example

[Visual Basic .NET]

Dim Result As Object
Dim oAmount As Object
' oAmount is a Currency Object 
DataFunctions df = New DataFunctions()
' Set to USA
myLocale = 1033
df.Locale = myLocale
Result = df.LocalizeCurrency(oAmount, myLocale, "$")
Response.Write("USA: " & Result & "<P>")
' Set to Minbar
myLocale = 1036
df.Locale = myLocale
Result = df.LocalizeCurrency(oAmount, myLocale, "MB")
Response.Write("Minbar: " & Result & "<P>")

[C#]

No example available.

Requirements

Namespace: Microsoft.CommerceServer.Interop

Platforms: Windows 2000, Windows Server 2003

Assembly: mscsasphelplib (in mscsasphelplib.dll)

See Also

DataFunctions Class

DataFunctions.Locale

DataFunctions.ConvertStringToCurrency

Copyright © 2005 Microsoft Corporation.
All rights reserved.