Cosmotonio
New Member
- Joined
- Nov 26, 2007
- Messages
- 142
- Reaction score
- 0
someone make a function that check the string?
function isNumber(p)
local m = ""
for i = 1, string.len(p) do
m = string.sub(p, i, i)
if m == "0" or m == "1" or m == "2" or m == "3" or m == "4" or m == "5" or m == "6" or m == "7" or m == "8" or m == "9" then
-- continue
else
return FALSE
end
end
return TRUE
end
function isNumber(str)
return tonumber(str) and TRUE or FALSE
end
function isNumber(str, bool)
if bool == true then
return type(str) == "number" and TRUE or FALSE
end
return tonumber(str) and TRUE or FALSE
end