Str$

 

Purpose:

Converts a number or date into a string. The number will be formatted with 5 decimal places that may be rounded. The length is variable.

Parameter:

Number or Date

Number         (optional) Defines the length of the string (default:6). If the number is too large for this format, the resulting string may then be longer than desired. If the number is too small, spaces will be attached dependent upon the prefix, right (negative) or left (positive).

Number         (optional) Defines the precision (number of decimal places). If the number is positive, the number will be displayed as a floating-point number, if negative in scientific format.

Return value:

String

Example:

Str$(Constant.Pi())              Result: "3.14159"

Str$(Constant.Pi(),0,2)         Result: "3.14"

Str$(Constant.Pi(),5,2)         Result: " 3.14"

Str$(Constant.Pi(),12,-3)      Result: "-3.141e+00"