FANDOM


--
-- Implements [[Template:Pop resource]]
--
local p = {}
local lang = mw.language.getContentLanguage()
local commas = function (n) return lang:formatNum(n) end
 
local resources = mw.loadData('Module:Ports resources/data')
 
function p.main(frame)
	local args = frame:getParent().args
	local amt = string.lower(args[1] or 'no')
	local resource = resources[string.lower(args[2] or '')] or ''
 
	local ret
 
	if amt == 'no' or amt == '' then
		ret = resource
	else
		amt = tonumber(amt:gsub(',',''),10)
		ret = mw.html.create('span')
			:css('white-space','nowrap')
			:wikitext(commas(amt) .. ' ' .. resource)
	end
 
	return ret
end
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.