Module:Currency

From The Satanic Wiki
Jump to navigation Jump to search

Documentation for this module may be created at Module:Currency/doc

-- <nowiki>
-- Shows currency information based on ISO 4217
local p = {}
local data = mw.loadData("Module:Currency/data")
local getArgs = require("Module:Arguments").getArgs

local function getCurrencyInfo(currencyCode, currencyInfo)
    local currency = data[currencyCode:upper()]

    if currency and currency[currencyInfo] then
        return currency[currencyInfo]
    end
end

function p.main(frame)
	local args = getArgs(frame)
    return getCurrencyInfo(frame.args[1], frame.args[2])
end

return p