local w={}w.Name="\078\117\109\098\101\114"w.Default="\048"function w.Process(j,w)local i=w:gsub("\091\094\037\100\046-\093","")local b=i:sub(1,1)i=b..(i:sub(2)):gsub("\037-","")local c=i:find("\037\046")if c then local w=i:sub(1,c)local j=(i:sub(c+1,#i)):gsub("\091\037\046\093","")return w..j end return i end function w.Verify(j,w)local i=w:find("\091\094\037\100\046-\093")if not i then if w:sub(1,1)=="-"then i=(w:sub(2)):find("\037-")if i or#w==1 then return false end end i=w:find("\037\046")if i then local j=(w:sub(i+1,#w)):find("\037\046")return not j end return true end return false end function w.ToType(j,w)w=j:Verify(w)and w or j.Default return tonumber(w)end return w
local Mask = {}

Mask.Name = "Number"
Mask.Default = "0"

function Mask:Process(text)
	local new = text:gsub("[^%d.-]", "")
	
	local neg = new:sub(1, 1)
	new = neg .. new:sub(2):gsub("%-", "")
	
	local found = new:find("%.")
	if (found) then
		local a = new:sub(1, found)
		local b = new:sub(found + 1, #new):gsub("[%.]", "")
		return a .. b
	end
	
	return new
end

function Mask:Verify(text)
	local find = text:find("[^%d.-]") -- find any non number, decimal, negative
	if (not find) then
		if (text:sub(1, 1) == "-") then
			find = text:sub(2):find("%-")
			if (find or #text == 1) then
				return false
			end
		end
		
		find = text:find("%.")
		if (find) then
			local new = text:sub(find + 1, #text):find("%.") -- check for second decimal
			return not new
		end
		
		return true
	end
	return false
end

function Mask:ToType(text)
	text = self:Verify(text) and text or self.Default
	return tonumber(text)
end

return Mask