Module:Category described in year: Difference between revisions

Content deleted Content added
Tweak addord
m Lua's subpar regex
Line 10:
if tonumber(i) then
local s = tostring(i)
local tens, ones = string.match(s, '(1?)(%d)$')
local ones = string.match(s, '%d$')
if tens then return s..'th'
elseif ones == '1' then return s..'st'
elseif ones == '2' then return s..'nd'