DataFunctions.ConvertNumberString Method

The ConvertNumberString method converts a string expression of a number to an Integer Variant, based on the specified locale. If successful, ConvertNumberString returns an Integer Variant containing the converted value; otherwise, Null.

Syntax

DataFunctions.ConvertNumberString(Number, Locale)

Parameters

Number
A string representation of the number to convert.
Locale
Optional. This number specifies the locale to use to convert the string. For a list of valid locale values, see Hexadecimal Locale Identifiers. If this parameter is not specified, the value of the DataFunctions object’s Locale parameter is used.

Remarks

The ConvertNumberString method is designed to accept only integers. Passing a floating-point number as the Number parameter results in an error. To convert floating-point numbers, use ConvertFloatString.

Example

The following example uses ConvertNumberString to convert 123,000 from a string to a number:

StrNum = "123,000"
NNum = DataFunctions.ConvertNumberString(StrNum, &H0409)

In this example, the call to ConvertNumberString returns the following value:

123000

Related Topics


© 1997-1998 Microsoft Corporation. All rights reserved.