local A={}A.Name="\078\117\109\098\101\114"A.Default="\048"function A.Process(m,A)local Y=A:gsub("\091\094\037\100\046-\093","")local x=Y:sub(1,1)Y=x..(Y:sub(2)):gsub("\037-","")local a=Y:find("\037\046")if a then local A=Y:sub(1,a)local m=(Y:sub(a+1,#Y)):gsub("\091\037\046\093","")return A..m end return Y end function A.Verify(m,A)local Y=A:find("\091\094\037\100\046-\093")if not Y then if A:sub(1,1)=="-"then Y=(A:sub(2)):find("\037-")if Y or#A==1 then return false end end Y=A:find("\037\046")if Y then local m=(A:sub(Y+1,#A)):find("\037\046")return not m end return A~=""end return false end function A.ToType(m,A)A=m:Verify(A)and A or m.Default return tonumber(A)end return A
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
		
		-- Empty string is not a number
		return text ~= ""
	end
	return false
end

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

return Mask