Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Sandbox/Szqecs/New Taiwan dollar
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
-- 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 end end 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 = { ['k'] = ' thousand' ,['m'] = ' million' ,['b'] = ' billion' ,['t'] = ' trillion' ,['q'] = ' quadrillion' } 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({' (US$', MinC, MaxC, magC, today, ')'}) else conversion = '' end return table.concat({symbol, Min, Max, mag, year, conversion}) end function p.main(frame) local _args = frame:getParent().args or frame.args local args = { Min = tonumber(_args[1]) ,Max = tonumber(_args[2]) ,link = yesno(_args.link) or yesno(_args.l) or true ,mag = _args.mag or _args.m or _args.o ,convert = yesno(_args.conv) or yesno(_args.c) or true ,year = _args.year ,showYear = yesno(_args.showYear) or yesno(_args.sy) or yesno(_args.sd) or false } local data = { ['USDTWD'] = mw.loadData('Module:New Taiwan dollar/USDTWD annual') ,['CPI'] = mw.loadData('Module:New Taiwan dollar/CPI annual') } return p._main(args, data) end
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Sandbox/Szqecs/New Taiwan dollar/doc
(
edit
)