Module:Sandbox/Szqecs/New Taiwan dollar explained

-- Function allowing for consistent treatment of boolean-like wikitext input.local function yesno(val, default) val = type(val)

'string' and val:lower or val if val

nil then return nil elseif val

true or val

'yes' or val

'y' or val

'true' or val

't' or val

'on' or tonumber(val)

1 then return true elseif val

false or val

'no' or val

'n' or val

'false' or val

'f' or val

'off' or tonumber(val)

0 then return false else return default endend

local p =

function p._main(args, data) if args.link

true then symbol = '\[\[New Taiwan dollar|NT$\]\]' else symbol = 'NT$' end local lang = mw.getContentLanguage local Min = lang:formatNum(args.Min) local Max = '–' .. lang:formatNum(args.Max) local magTable = local mag = ' ' .. magTable[args.mag] local MinC = args.Min / USDTWD if MaxC then MaxC = '–' .. args.Max / USDTWD end if args.showDate

false then year = else year = ' in ' .. year end if args.convert

true then conversion = table.concat else conversion = end return table.concatend

function p.main(frame) local _args = frame:getParent.args or frame.args local args = local data = return p._main(args, data)end