DataFunctions.ConvertNumberString Method (PIA)
Use this method to convert an integer represented as a string to an integer object, based on the default or specified locale.
Definition
[Visual Basic .NET]
Imports Microsoft.CommerceServer.Interop
…
Public Function ConvertNumberString(vtNum As Object,
Optional vtLocale As Object) As Object
[C#]
using Microsoft.CommerceServer.Interop;
…
public object ConvertNumberString(objectvtNum,
objectvtLocale);
Parameters
[Visual Basic .NET]
- vtNum
An Object that contains a string representation of the number to convert. - vtLocale
An Object that specifies the locale to use to convert the string. If this parameter is not specified, the value of the Locale property of the DataFunctions object is used.
[C#]
- vtNum
An object that contains a string representation of the number to convert. - vtLocale
An object that specifies the locale to use to convert the 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 an integer Object containing the converted number; otherwise, Null is returned.
[C#] This method returns an object containing the converted number.
Exceptions
This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.
Remarks
ConvertNumberString method is designed to accept only integers. Passing a floating-point number as the vtNum parameter results in an error. To convert floating-point numbers, use the ConvertFloatString method.
Example
[Visual Basic .NET]
' Converts integer string using US and France locales
' oSourceInt is an Object containing an integer string
Dim Result As Object
DataFunctions df = New DataFunctions()
df.Locale = 1036
Result = df.ConvertNumberString(oSourceInt)
Response.Write("France: " & Result & "<P>")
df.Locale = 1033
Result = df.ConvertNumberString(oSourceInt)
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.ConvertFloatString
Copyright © 2005 Microsoft Corporation.
All rights reserved.