Share via


DataFunctions.Money Method (PIA)

Use this method to convert an int that contains a monetary value to an equivalent string representation, based on the default or specified locale.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop
…
Public Function Money(lMoney As Integer,
 vtLocale As Object) As Object

[C#]

using Microsoft.CommerceServer.Interop;
…
public object Money(intlMoney,
 objectvtLocale);

Parameters

[Visual Basic .NET]

  • lMoney
    An Integer that contains the monetary value to convert to a string, specified in the base monetary unit of the locale used to perform the conversion. (This value is not an OLE currency type.)
  • vtLocale
    An Object that specifies the locale to use to convert the monetary value to a string. If this parameter is not specified, the value of the Locale property of the DataFunctions object is used.

[C#]

  • lMoney
    An int that contains the monetary value to convert to a string, specified in the base monetary unit of the locale used to perform the conversion. (This value is not an OLE currency type.)
  • vtLocale
    An object that specifies the locale to use to convert the monetary value to a string. If you want the value of the Locale 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 a string Object that contains a string representation of the specified monetary value; otherwise, Null is returned.

[C#] This method returns an object containing the resultant string.

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 Amount As Integer
' Amount is an integer containing a monetary value in base currency units
' (base currency unit for US is cents)
DataFunctions df = New DataFunctions()
myLocale = 1036
df.Locale = myLocale
Result = df.Money(Amount, myLocale)
Response.Write("France: " & Result & "<P>")
myLocale = 1033
df.Locale = myLocale
Result = df.Money(Amount, myLocale)
Response.Write("USA: " & Result)

[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.ConvertMoneyStringToNumber

Copyright © 2005 Microsoft Corporation.
All rights reserved.