tonumber(argument)
-- store the string '123' in myString
local
myString =
'123'
-- this will cause an error because Lua can't work out if it should
-- convert the string to a number or the number to a string
if
(myString > 100)
then
end
-- So we force the string to be a number and it works.
if
(
tonumber
(myString) > 100)
then
fibaro:debug
(
"This works - it's more than 100!"
)
end
tostring
Lua reference manual 5.2: tonumber