toString (Function)

Signature: toString(value: int | float | bool | string | Unit | any | Result<printable, printable>) -> string

Description: Formats the same scalar and Result values accepted by print without writing output. Unit renders as 0.

Parameters

  • value (int | float | bool | string | Unit | any | Result<printable, printable>): The value to convert to string

Returns: string

Example

let str = toString(42)
print(str)  // Prints: 42
str = toString 42
print str  // Prints: 42