Modul:Ordinal: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
Dari WP:EN. |
fix |
||
Baris 1:
--[[
This template will add the appropriate ordinal
Please do not modify this code without applying the changes first at
Baris 10:
local p = {}
--[[
Baris 18 ⟶ 16:
Usage:
{{#invoke:Ordinal|ordinal|1
{{#invoke:Ordinal|ordinal}} - uses the caller's parameters
Parameters
1: Any number or string.
]]
function p.ordinal(frame)
Baris 34 ⟶ 30:
args[1] = "{{{1}}}"
end
return p._ordinal(args[1]
end
function p._ordinal(n
local x = tonumber(mw.ustring.match(n, "(%d*)%W*$"))
local
▲ return n .. suffix
end
|