FormatStoredNumberToText

Converts a number passed as a Double to a String, formatting the String with the decimal and thousands delimiters that you specify. Use this method to format numbers returned by Financial Management methods such as GetCell and GetCells.

Syntax

<HsvData>.FormatStoredNumberToText(dNumber, lStatus, sDecimalChar, sThousandsChar)

Argument

Description

dNumber

Double (ByVal). The number to be formatted.

lStatus

Long (ByVal). A valid cell status. The expected usage is that you pass the cell status returned by a method such as GetCell or GetCells.

sDecimalChar

Integer (ByVal). The double-byte Integer that identifies the decimal to be used in the return value. Use AscW to get the delimiter’s Integer equivalent.

sThousandsChar

Integer (ByVal). The double-byte Integer that identifies the thousands delimiter to be used in the return value. Use AscW to get the delimiter’s Integer equivalent.

Return Value

String. Returns the formatted String equivalent of the Double passed to the dNumber argument.

Example

The following example formats the number passed to FormatStoredNumberToText using a comma as a decimal character and periods as the thousands separator character. For example, if 19398736.23 is passed, 19.398.736,23 is assigned to the sRet variable.

Dim cData As HsvData, iDec As Integer
Dim iThous As Integer, sRet As String
Set cData = m_cSession.Data
iDec = AscW(",")
iThous = AscW(".")
sRet = cData.FormatStoredNumberToText(m_dNum, m_lStat, iDec, _ 
iThous)