Str

Converts a number to a character string. FormCalc formats the result to the specified width and rounds to the specified number of decimal places.

Syntax

Str(n1 [, n2 [, n3 ]])

Parameters

Parameter

Description

n1

The number to convert.

n2 (Optional)

The maximum width of the string. If you do not include a value for n2, the function uses a value of 10 as the default width.

If the resulting string is longer than n2, the function returns a string of * (asterisk) characters of the width specified by n2.

n3 (Optional)

The number of digits to appear after the decimal point. If you do not include a value for n3, the function uses 0 as the default precision.

Examples

The following expressions are examples that use the Str function:

Expression

Returns

Str(2.456)

" 2"

Str(4.532, 6, 4)

4.5320

Str(234.458, 4)

" 234"

Str(31.2345, 4, 2)

****

Str(Max(Amount[*]), 6, 2)

Converts the largest occurrence of Amount to a six-character string with two decimal places.

See also Max.

// Ethnio survey code removed