Skip to main content

tonumber

Tries to convert its argument to a number. If the argument is a number, a string or a number cdata object convertible to a number, then tonumber returns this number; otherwise, it returns nil.

tonumber(value, base: number)

Arguments

NameDescriptionType
valueThe argument to convert to a number.unknown
baseThe base to use when converting the number.number