Changes

Jump to navigation Jump to search

Overview of the API

304 bytes added, 15:28, 7 April 2013
tonumber
Line 16: Line 16:  
*'''[[setmetatable]]'''(obj, mtable) - Sets the metatable of the given table or userdata object.  
 
*'''[[setmetatable]]'''(obj, mtable) - Sets the metatable of the given table or userdata object.  
 
*'''[[tostring]]''' - 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. - taken from Lua Docs.  
 
*'''[[tostring]]''' - 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. - taken from Lua Docs.  
 +
*'''[[tonumber]]''' - tonumber (e) - Receives an argument of the string type and converts it to a number when possible. If the metatable of e has a "__tonumber" field, then tonumber calls the corresponding value with e as argument, and uses the result of the call as its result. - taken from Lua Docs.
 +
 
*'''[[type]]'''(var) - Returns the type of variable as a string, "number", "string", "table", "function" or "userdata".  
 
*'''[[type]]'''(var) - Returns the type of variable as a string, "number", "string", "table", "function" or "userdata".  
 
*'''[[unpack]]'''(table[, start][, end]) - Returns the contents of its argument as separate values.  
 
*'''[[unpack]]'''(table[, start][, end]) - Returns the contents of its argument as separate values.  

Navigation menu