<<

Contents

Search

>>

 

STRNUM$

 

 

Function

 

 

Syntax:

STRNUM$(<Value>,<Length of String>[,<Post Decimal Positions>[,<Decimal Separator>[,<Grouping Separator>[,<Sign>[,<Zero Suppression>]]]]])

 

<Value>

= <NUM-EXPRESSION>

<Length of String>

= <NUM-EXPRESSION>

<Post Decimal Positions>

= <NUM-EXPRESSION>

<Decimal Separator>

= <STRING-EXPRESSION>

<Grouping Separator>

= <STRING-EXPRESSION>

<Sign>

= <NUM-EXPRESSION>

<Zero Suppression>

= <NUM-EXPRESSION>

 

 

Meaning:

Formats a numeric value as a string.

 

Parameter:

Value

Numeric value

 

Length of String

Defines the length of the returned String.

 

Post Decimal Positions

Defines the number of post decimal positions. If this parameter, then <Post Decimal Positions> = 0.

 

Decimal Separator

Specifies the character for the decimal point. This parameter only has a meaning if <Post Decimal Positions> > 0. If this parameter is missing or if <Decimal Separator> is the empty string "", the standard decimal point is used.

 

Grouping Separator

Specifies the character for the grouping separator. If this parameter is missing or if <Grouping Separator> is the empty string "", the thousands separators are not displayed.

 

Sign

Defines where the sign is put with negative numbers. If <Sign> = 0, the sign is put before the 1st number, otherwise on the first position of the character string.

 

Zero Suppression

Specifies whether leading zeros are to be displayed. If this parameter is missing or if it is 0, leading zeros are replaced by blanks. If <Zero Suppression> = -1, leading blanks are removed. In this case the length of character strings returned by STRNUM$ can be shorter than <Length of String>.

 

Sample:

Function

Result

STRNUM$(1234.56,12)

STRNUM$(1234.56,12,2)

STRNUM$(1234.56,12,2,",")

STRNUM$(1234.56,12,2,",",".")

STRNUM$(-1234.56,12,2,",",".",1)

STRNUM$(-1234.56,12,2,",",".",1,0)

STRNUM$(1234.56,12,2,",",".",1,-1)

"        1234"

"     1234,56"

"      234.56"

"    1.234,56"

"-   1.234,56"

"-.001.234,56"

"1.234,56"

 

See also:

STR$

STR0$

STRN$

STRFORMAT$

STRVAL$

VAL