Module:Category described in year: Difference between revisions

Content deleted Content added
m top: per Wikipedia:Categories for discussion/Log/2019 April 16, replaced: Years in paleontology → Paleontology by year
Tweak addord
Line 7:
--[[==========================================================================]]
 
local function addOrd( i ) --2012 -> 20th12th, etc.
if tonumber(i) then
local s = tostring(i)
local lastdtens, ones = mw.ustringstring.match(s, '(1?)(%d)$')
if lastdtens == '1' then return s..'stth'
elseif lastdones == '21' then return s..'ndst'
elseif lastdones == '32' then return s..'rdnd'
elseif lastdones ~== nil'3' then return s..'thrd'
elseif ones ~= nil then return s..'th'
end
end