Filter
Prijs
–
Geen verzendkosten
Fabrikant
tonumber()
Action :
Tries to convert the passed value into a number.
Usage and parameter :
tonumber(argument)
- argument: Een argument van een willekeurig type dat omgezet dient te worden naar een getal.
Returned value :
A nummeric value.
Programming example :
-- assign a string to a variable mystring
local mystring = '123'
-- Example below will result in an error message since mystring is not a number.
if (mystring > 100) then
end
-- Thats why we convert a string into a nummeric value.
-- Example : Put the device off when 'Brightness" is more thant 50.
if (tonumber(mystring) >10) then
fibaro:debug('This works, the variable is more than 10');
end
See also:
tosting()
LUA reference manual 5.2 : tonumber
Geen producten gevonden.