G.tonumber
From GMod Wiki
Function | |
Syntax |
tonumber( Var var,Integer Base ) Where is this used? |
Description: | |
Attempts to cast the argument to a number. Returns nil if it is not a number. | |
Returns: | Integer |
Part of Library: | Global Functions |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.tonumber]G.tonumber [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Convert to a number |
---|---|
Used on | |
Code | print( type( tonumber( "5" ) ) |
Output | Number |
Description | Convert to a number |
---|---|
Used on | |
Code | print( type( tonumber( "e5" ) ) |
Output | [[]] |