Tostring: Difference between revisions
From GiderosMobile
Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === Receives an argument of any type and converts it to a string in a reasonable format. For complete cont..." |
No edit summary |
||
| Line 6: | Line 6: | ||
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. | 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. | ||
<source lang="lua"> | <source lang="lua"> | ||
(string) | (string) = tostring(e) | ||
</source> | </source> | ||
'''e | '''e''': (any) value to convert to string ''''''<br/> | ||
'''Returns''' (string) value converted to string or nil<br/> | '''Returns''' (string) value converted to string or nil<br/> | ||
Revision as of 09:17, 23 August 2018
Available since: Gideros 2011.6
Description
Receives an argument of any type and converts it to a string in a reasonable format. 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.
(string) = tostring(e)
'e: (any) value to convert to string '
Returns (string) value converted to string or nil