Module:High-use: Difference between revisions

m
Changed protection settings for "Module:High-use": High-risk template or module: 3784 transclusions (more info) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite))
m (1 revision imported from wikipedia:Module:High-use)
m (Changed protection settings for "Module:High-use": High-risk template or module: 3784 transclusions (more info) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite)))
Line 40:
return_value = string.format("approximately %s", mw.getContentLanguage():formatNum(math.floor( (count / 10^(f)) + 0.5) * (10^(f))) )
end
-- Insert percentage of pages if that is likely to be >= 1%
if count and count > 250000 then
local magic_word = yesno (frame:getParent().args['article-space']) and 'NUMBEROFARTICLES' or 'NUMBEROFPAGES';
local percent = math.floor( ( (count/frame:callParserFunction(magic_word, 'R') ) * 100) + 0.5)
 
-- Insert percentage of pages if that is likely to be >= 1% and when |no-percent= not set to yes
if count and count > 250000 and not yesno (frame:getParent().args['no-percent']) then
local percent = math.floor( ( (count/frame:callParserFunction(magic_word'NUMBEROFPAGES', 'R') ) * 100) + 0.5)
if percent >= 1 then
return_value = string.format("%s pages, or roughly %s%% of all", return_value, percent)
Line 88 ⟶ 86:
end
local templateCount = ('on [https://templatecount.toolforge.org/index.php?lang=en&namespace=%s&name=%s %s %spages]'):format(
mw.title.getCurrentTitle().namespace, mw.uri.encode(title.text), p.num(frame, count), yesno (frame:getParent().args['article-space']) and 'articles' or 'pages')
local used_on_text = "'''This " .. (mw.title.getCurrentTitle().namespace == 828 and "Lua module" or "template") .. ' is used ';
if systemMessages then
Anonymous user