FormatTextToNumber

Takes a number stored in a String and converts it to a Double. If the lAccount argument identifies a revenue, expense, asset, or liability account, FormatTextToNumber also scales the return value.

Syntax

<HsvData>.FormatTextToNumber(lEntity, lParent, lValue, lAccount, bstrText, vbUseDefaultScale, sAlternateScale, vbUseTheUsersFormattingParameters, pbIsValidNumber, pbIsNumberNoData)

Argument

Description

lEntity

Long (ByVal). If the lValue argument specifies the <Entity Currency>, <Entity Curr Adjs>, or <Entity Curr Total> Value dimension member, FormatNumberToText scales the return value by using the Scale attribute of the entity’s default currency.

Otherwise, you must pass in a valid Entity dimension member ID, but the scaling is determined by the lParent or lValue argument.

lParent

Long (ByVal). The member ID of the parent of the lEntity argument’s entity. If the lValue argument specifies the <Parent Currency>, <Parent Curr Adjs>, or <Parent Curr Total> Value dimension member, FormatNumberToText scales the return value by using the Scale attribute of this parent entity’s default currency.

Otherwise, you must pass in a valid Entity dimension member ID, but the scaling is determined by the lEntity or lValue argument.

lValue

Long (ByVal). A valid Value dimension ID. If the lAccount argument identifies a revenue, expense, asset, or liability account, FormatTextToNumber scales the return value. Use this argument to pass the member ID of the Value dimension member for the currency whose Scale attribute is to be applied to the return value.

Note:

If you pass the member ID of the <Entity Currency>, <Entity Curr Adjs>, <Entity Curr Total>, <Parent Currency>, <Parent Curr Adjs>, or <Parent Curr Total> Value dimension member, the scaling is determined by the lEntity and lParent arguments as described above.

lAccount

Long (ByVal). The member ID of an Account dimension member. If the member is a revenue, expense, asset, or liability account, FormatTextToNumber scales the return value.

bstrText

String (ByVal). The text to be converted to a Double. The text must be numeric; the pbIsValidNumber argument returns FALSE if this argument is non-numeric.

vbUseDefaultScale

Boolean (ByVal). Specify TRUE to apply the Scale attribute of the currency identified by the lValue argument, otherwise FALSE. If you specify FALSE, the sAlternateScale argument sets the scaling to be applied.

sAlternateScale

Integer (ByVal). If you set the vbUseDefaultScale argument to FALSE, this argument specifies the degree of scaling to be applied to the return value.

If you set the vbUseDefaultScale argument to TRUE, this argument’s value is ignored.

vbUseTheUsersFormatting Parameters

Boolean (ByVal). Determines whether FormatTextToNumber uses the user’s preferred decimal and thousands separator characters or the system default characters when it reads the bstrText argument. Pass TRUE to use the user’s preferred characters, FALSE to use the system defaults.

pbIsValidNumber

Boolean. Returns TRUE if the bstrText argument is a valid number that can be converted, otherwise FALSE.

pbIsNumberNoData

Boolean. Returns TRUE if the bstrText argument is 0, otherwise FALSE.

Return Value

Double. The number passed as the bstrText argument, converted to a String and scaled as specified by the arguments.