GetDoubleFromText

Converts a numeric string to a Double subtype.

Syntax

<HFMwData>.GetDoubleFromText bstrText, bstrDecimalChar, bstrThousandsChar, pbIsValidNumber, pbIsNumberNoData, pvardNumber

Argument

Description

bstrText

The string to be converted.

Input argument. String subtype.

bstrDecimalChar

Specifies the decimal separator character.

Input argument. String subtype.

bstrThousandsChar

Specifies the thousands separator character.

Input argument. String subtype.

pbIsValidNumber

Indicates whether the bstrText argument’s string can be evaluated as a Double. Returns TRUE if he string can be evaluated as a Double, FALSE otherwise.

Output argument.

pbIsNumberNoData

Indicates whether the bstrText argument’s string evaluates to no data. Returns TRUE if the string evaluates to no data, FALSE otherwise.

For example, a blank string passed to the bstrText argument would evaluate to no data.

Output argument.

pvardNumber

Returns the Double equivalent of the bstrText argument.

Note:

If the pbIsValidNumber argument returns FALSE, or the pbIsNumberNoData argument returns TRUE, then the bstrText argument’s string returns 0.

Output argument.

Example

The following function converts a string to a Double, using the application’s default decimal and thousands separator characters. If the passed string evaluates to no data, the function returns null.

Function GetDoubleDefaultSeparators(sNum)
Dim cHFMData, bIsValid, bIsNoData, sRetVal
Set cHFMData = Server.CreateObject("Hyperion.HFMwData")
' cHFMSession is a previously set HFMwSession object
cHFMData.SetWebSession cHFMSession
cHFMData.GetDoubleFromText sNum, cHFMSession.decimalSeparator, _ 
cHFMSession.thousandsSeparator, bIsValid, bIsNoData, dRetVal
If bIsNoData = TRUE Then
  GetDoubleDefaultSeparators = null
Else
  GetDoubleDefaultSeparators = dRetVal
End If
End Function