Jump to content
Main menu
Main menu
move to sidebar
hide
Gushakisha
Urupapuro nyamukuru
Ubwinjiriro rusangi
Impinyanyuro ziheruka
Urupapuro rushoboka
Gufasha
Impapuro zisangije
Rondeza
Rondeza
Appearance
Tanga ingabire
Ugurura umurongo
Injiramwo
Ibikoresho vyisangijwe
Tanga ingabire
Ugurura umurongo
Injiramwo
Pages for logged out editors
learn more
Intererano
Ikiyago
Uguhinyanyura
Module:Ordinal
Add languages
Module
Ikiganiro
English
Soma
Hinyanyura inkomoko
View history
Ibikoresho
Tools
move to sidebar
hide
Actions
Soma
Hinyanyura inkomoko
View history
General
Ni igiki gisanisha hano
Hinyanyura
Cukura dosiye
Ibimenyeshejwe kumpapuro
Get shortened URL
Download QR code
Appearance
move to sidebar
hide
Igabisha:
Ntiwinjiye k'umurongo. Izina rya IP yawe riraza kugaragara igihe hari ico uhinduye. Niba
winjiye k'umurongo
canke
wuguruye ikonti
, ivyo wahinduye bizitirirwa izina ukoresha, ndetse n'izindi nyungu.
Anti-spam check. Do
not
fill this in!
--[[ This template will add the appropriate ordinal suffix to a given integer. Please do not modify this code without applying the changes first at Module:Ordinal/sandbox and testing at Module:Ordinal/sandbox/testcases and Module talk:Ordinal/sandbox/testcases. ]] local p = {} local yesno = require('Module:Yesno') -- boolean value interpretation --[[ This function converts an integer value into a numeral followed by ordinal indicator. The output string might contain HTML tags. Usage: {{#invoke:Ordinal|ordinal|1=|2=|sup=}} {{#invoke:Ordinal|ordinal}} - uses the caller's parameters Parameters 1: Any number or string. 2: Set to "d" if the module should display "d" instead of "nd" and "rd". sup: Set to yes/no to toggle superscript ordinal suffix. ]] function p.ordinal(frame) local args = frame.args if args[1] == nil then args = frame:getParent().args end if args[1] == nil then args[1] = "{{{1}}}" end return p._ordinal(args[1], (args[2] == 'd'), yesno(args.sup)) end function p._ordinal(n, d, sup) local x = tonumber(mw.ustring.match(n, "(%d*)%W*$")) local suffix = "th" -- If tonumber(n) worked: if x then local mod10 = math.abs(x) % 10 local mod100 = math.abs(x) % 100 if mod10 == 1 and mod100 ~= 11 then suffix = "st" elseif mod10 == 2 and mod100 ~= 12 then if d then suffix = "d" else suffix = "nd" end elseif mod10 == 3 and mod100 ~= 13 then if d then suffix = "d" else suffix = "rd" end end end if sup then suffix = "<sup>" .. suffix .. "</sup>" end return n .. suffix end return p
Incamake:
Ubitse impinyanyuro, uba wemeye
Terms of Use
, kandi uba wemeye gutanga intererano ubutisubirako kuri
CC BY-SA 4.0 License
na
GFDL
. Wemeye ko hyperlink canke URL ari umugabane kuri licence ya Creative Commons.
Futa
Imfashanyo y'impinyanyuro
(ugurura mw'idirisha rindi)
Preview page with this template
Wikidata entities used in this page
Module:Ordinal
: Sitelink, Description: en
Ingero i koreshwa kuri uru rupapuro:
Module:Ordinal/doc
(
hinyanyura
)
Rondeza
Rondeza
Uguhinyanyura
Module:Ordinal
Add languages
Add topic