Lua string to int
snippet in lua

Lua string to int

user4191

local function ToInteger(number)
    return math.floor(tonumber(number) or error("Could not cast '" .. tostring(number) .. "' to number.'"))
end