Difference between revisions of "Tostring"

From OpenEUO
Jump to: navigation, search
(Created page with " tostring (e) 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 m...")
 
 
Line 2: Line 2:
 
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.
 
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.  
+
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.
 +
 
 +
[[Tonumber]]
  
 
[[String.format]]
 
[[String.format]]

Latest revision as of 11:18, 9 October 2010

tostring (e)

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.

Tonumber

String.format