TOSTRING function

Synopsis
This function returns a string representation of a value of another data type. This function is useful for quickly producing a string representation of results to be displayed or written to a log.
Remarks
Variations
TOSTRING(Value)
Returns a string representation of the specified value.
Parameters
Value

Specifies the value to be returned as string.

Supported types: Numeric; String; Boolean; Point; TimeStamp; Fixture.
Returns
Returned types: String.
Examples
1.

The following example returns a string representation of the fixture (for example, "Fixture(X=62.03, Y=59.90, Angle=50.202)").

TOSTRING(Flowcharts("BoardFinder").DefineWholeBoard.OutputFixture)
TOSTRING(Value, Format)
Returns a string representation of the specified number, in the specified format .
Parameters
Value

Specifies the value to be returned as string.

Supported types: Numeric.
Format

Specifies the format that the returned string should use.

The following are common formatting codes:

Value Description
"8:F2"

Rounds the value to 2 decimal places, or pads it with "0"s on the right. Pads the result to 8 characters with empty spaces on the left. The decimal point is included in the character count.

(summarize)
":0000"

Rounds the value to the nearest whole number and pads it to 4 digits with "0"s on the left.

":%#"

Multiplies the value by 100, rounds it to the nearest whole number, and appends the % sign before or after the number depending on where it appears in the formatting code.

":%#.#"

Multiplies the value by 100, rounds it to 1 decimal place and appends the % sign before or after the number depending on where it appears in the formatting code.

":.00"

Rounds the value to 2 decimal places, or pads it with "0"s on the left.

":.##"

Rounds the value to 2 decimal places.

":F2"

Rounds the value to 2 decimal places, or pads it with "0"s on the right.

Supported types: String.
Returns
Returned types: String.
Examples
1.

The following example returns 5 empty spaces, followed by "64.2700".

TOSTRING(64.27,"12:F4")
2.

The following example returns "64.2700"

TOSTRING(64.27,"1:F4")
3.

The following example returns "00006427"

TOSTRING(6427,":00000000")
4.

The following example returns "64%"

TOSTRING(0.6427,":#%")