Garry's Mod Wiki

tonumber

  number tonumber( any value, number base = 10 )

Description

Attempts to convert the value to a number.

Arguments

1 any value
The value to convert. Can be a number or string.
2 number base = 10
The base used in the string. Can be any integer between 2 and 36, inclusive.

Returns

1 number
The numeric representation of the value with the given base, or nil if the conversion failed.