Convert string to variable number
Hello guys, i figured it, idk if anybody needs this too, but when makes some configs, like lua varations of comparation like:
Code:
mincap = getuseroption("MinCap")
if $cap < MinCap then
say("test")
end
It will result in error that not compare Number with String or String with Number
So the easy FIX is to add +0 in after the variable string, to convert it to a number like:
Code:
mincap = getuseroption("MinCap")
if $cap < mincap+0 then
say("test")
end
No string code error :)
[SIZE=10px]Tnx to, Invalid Name to his discovery![/SIZE]
http://puu.sh/5IqH5.png