IDataFunctions::ConvertNumberString

The ConvertNumberString method converts a string representation of a number to a long VARIANT, based on the specified locale.

Syntax

HRESULT ConvertNumberString(
VARIANT vtNum,// in
VARIANT vtLocale,// in
VARIANT *pvarNumber// out
);

Parameters

vtNum
A VARIANT that contains the string representation of the number to convert. The vt member of this VARIANT must be initialized to VT_BSTR, and its pbstrVal member must contain the BSTR value to convert.
vtLocale
A VARIANT that specifies the locale on which to base the conversion. If this VARIANT is empty (VT_EMPTY) or NULL (VT_NULL), ConvertNumberString uses the locale specified by a previous call to put_Locale.
pvarNumber
If successful, a pointer to a VARIANT that contains the converted value. ConvertNumberString initializes this VARIANT’s vt member to VT_I4, and stores the converted value in its lVal member. If unsuccessful, ConvertNumberString sets the Vt member to VT_NULL.

Include

<commerce.h>

Return Values

Value Description
S_OK The conversion was successful.
DISP_E_TYPEMISMATCH The value in vtNum is not a BSTR value.

Related Topic

IDataFunctions::ConvertFloatString, IDataFunctions::Money


© 1997-1998 Microsoft Corporation. All rights reserved.