Originally Posted by Billtopia
I was thinking that this may be better for you but not 100% the pattern is right. It should find any decimal number including decimals with a decimal portion and if that is the only thing on the line (not counting white spaces) then return true
lua Code:
function IsNumeric( data ) if type(data) == "number" then return true elseif type(data) ~= "string" then return false end data = strtrim(data) local x, y = string.find(data, "[%d+][%.?][%d*]") if x and x == 1 and y == strlen(data) then return true end return false end
|
Hmm thats seems good, but i think it's slower then my method.