Takes a number and returns it as a String, with the option to remove trailing zeroes. FormatNumberToText2 scales the number and puts a fixed number of digits to the right of the decimal point, adding or removing digits as needed. The method also returns the number of decimal places and the scaling applied to the formatted number.
By default, FormatNumberToText2 formats the returned number as follows:
FormatNumberToText2 scales by applying the Scale attribute of the applicable Value dimension member. This member is specified by either the lValue argument or the lEntity and lParent arguments; see the following table for details.
FormatNumberToText2 specifies the number of digits to the right of the decimal point by applying the NumDecimalPlaces attribute of the account identified by the lAccount argument.
FormatNumberToText2 also enables you to override this default formatting.
<HsvData>.FormatNumberToText2(lEntity, lParent, lValue, lAccount, dNumber, lStatus, vbUseDefaultNumDecimals, sAlternateNumDecimals, vbUseDefaultScale, sAlternateScale, vbUseTheUsersFormattingParameters, vbRemoveTrailingZeros, nNumDecimals, nScale)
Long (ByVal). If the lValue argument specifies the <Entity Currency>, <Entity Curr Adjs>, or <Entity Curr Total> Value dimension member, FormatNumberToText2 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. | |
Long (ByVal). The member ID of the parent of the Entity dimension member identified by the lEntity argument. If the lValue argument specifies the <Parent Currency>, <Parent Curr Adjs>, or <Parent Curr Total> Value dimension member, FormatNumberToText2 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. | |
Long (ByVal). The member ID of the Value dimension member for the currency whose Scale attribute is to be applied to the return value. 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. | |
Long (ByVal). The member ID of the Account dimension member whose NumDecimalPlaces attribute is to be applied to the return value. | |
Long (ByVal). The cell status; the status determines whether a 0 passed to the dNumber argument is returned as the string 0 or as the string NoData. The following list provides guidelines for this argument: | |
Boolean (ByVal). Specify TRUE to apply the NumDecimalPlaces attribute of the account identified by the lAccount argument, otherwise FALSE. If you specify FALSE, the number of decimal places is determined by the sAlternateNumDecimals argument. | |
Integer (ByVal). If you set the vbUseDefaultNumDecimals argument to FALSE, this argument specifies the number of decimal places to be applied to the return value. To use the application’s default number of decimals, pass the HFMConstants type library constant DEFAULT_NUM_DECIMALS, described in Number Defaults Constants. If you set the vbUseDefaultNumDecimals argument to TRUE, this argument is ignored. | |
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 specifies the scaling to be applied. | |
Integer (ByVal). If you set the vbUseDefaultScale argument to FALSE, this argument indicates the degree of scaling to apply to the return value. To leave the return value unscaled, pass 0. To scale the return value, each whole-number increment over 0 scales by a tenth. In other words, passing 1 scales by a tenth, passing 2 scales by a hundredth, and so on. To use the application’s default scaling, pass the HFMConstants type library constant DEFAULT_SCALE, described in Number Defaults Constants. If you set the vbUseDefaultScale argument to TRUE, this argument is ignored. | |
Boolean (ByVal). Determines whether the user’s preferred decimal and thousands separator characters should be applied to the return value. Pass TRUE to apply the user’s preferred characters, FALSE to apply the system defaults. | |
Boolean (ByVal). A flag that specifies whether to remove trailing zeroes. Pass TRUE to remove trailing zeroes, FALSE otherwise. | |
Integer. Returns the number of decimal places applied to the return value. | |
Integer. Returns the degree of scaling applied to the return value. |
String. The String equivalent of the number passed as the dNumber argument, formatted as specified by the arguments.