Garry's Mod Wiki

Revision Difference

Global.tonumber#548043

<function name="tonumber" parent="Global" type="libraryfunc"> <description> Attempts to convert the value to a number. Returns nil on failure. </description> <realm>Shared and Menu</realm> <args> <arg name="value" type="any">The value to convert. Can be a number or string.</arg> <arg name="base" type="number" default="10">The used in the string. Can be any integer between 2 and 36, inclusive.</arg> <arg name="base" type="number" default="10">The base used in the string. Can be any integer between 2 and 36, inclusive.</arg> </args> <rets> <ret name="" type="number">The numeric representation of the value with the given base, or nil if the conversion failed.</ret> </rets> </function>