Module:Demographics Religion

require "Module:Demographics Basics" require "Module:Demographics Database"

local function other_religions(country) local racial = total_table(demographics.race,country) local religious = total_table(demographics.religion,country) local other = math.abs(racial - religious) local other_faith = {} other_faith[country] = {} for key in orderedPairs(demographics.religion[country]) do   other_faith[country][key] = demographics.religion[country][key] end other_faith[country]["Other"] = other return other_faith end

local p={} function p.total(frame) local formatted=other_religions(frame.args[1]) return total_table(formatted,frame.args[1]) end

function p.main(frame) local formatted=other_religions(frame.args[1]) return fetch_table(formatted,frame.args[1],frame.args[2]) end function p.generate(frame) local formatted=other_religions(frame.args[1]) return generate(formatted,frame.args[1],"Religion") end return p