1
0
forked from tommy/tommy-bot

add src files

This commit is contained in:
tommy aka doge
2022-04-03 17:53:48 -04:00
parent 63fe8bdfe9
commit 5d20986e54
8 changed files with 470 additions and 0 deletions

9
src/modules/ordinal.lua Normal file
View File

@ -0,0 +1,9 @@
s=string.sub;t=tonumber
return function(n)
local o, d = {"st", "nd", "rd"}, s(n, -1)
if t(d) > 0 and t(d) <= 3 and s(n,-2) ~= 11 and s(n,-2) ~= 12 and s(n,-2) ~= 13 then
return n .. o[t(d)]
else
return n .. "th"
end
end