Tostring: Difference between revisions

From GiderosMobile
No edit summary
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
=== Description ===
=== <translate>Description</translate> ===
<translate>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.  
<translate>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.  


Line 8: Line 8:
(string) = tostring(e)
(string) = tostring(e)
</source>
</source>
=== Parameters ===
=== <translate>Parameters</translate> ===
'''e''': (any) <translate>value to convert to string</translate> <br/>
'''e''': (any) <translate>value to convert to string</translate> <br/>
=== Return values ===
=== <translate>Return values</translate> ===
'''Returns''' (string) <translate>value converted to string or nil</translate><br/>
'''<translate>Returns</translate>''' (string) <translate>value converted to string or nil</translate><br/>

Revision as of 06:27, 24 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)

Parameters

e: (any) value to convert to string

Return values

Returns (string) value converted to string or nil