Tostring

From GiderosMobile
Revision as of 15:33, 13 July 2023 by Hgy29 (talk | contribs) (Text replacement - "</source>" to "</syntaxhighlight>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2011.6
Class: (global)

Description

Receives an argument of any type and converts it to a string in a reasonable format.

(string) = tostring(e)
For complete control of how numbers are converted, use string.format.

If the metatable of e has a "__tostring" field, then tostring calls the corresponding value with e as argument, and uses the result of the call as its result.

Parameters

e: (any) value to convert to string

Return values

Returns (string) value converted to string or nil