Jump to content
Panginot na menu
Panginot na menu
move to sidebar
itago
Paglibot
Panginot na pahina
Portal kan komunidad
Dai pa sana nahahaloy na pagbabago
Dawa anong pahina
Tabang
Espesyal na mga pahina
Paghanap
Maghanap
Itsura
Mag-donate
Maggibo nin account
Mag-login
Pansadiring kagamitan
Mag-donate
Maggibo nin account
Mag-login
Pigbabago an
Module
:
Ordinal
Magdugang nin mga tataramon
Module
Pag-urulay
English
Basáhon
Baguhon an source
Tanawon sa historiya
Mga kagamitan
Mga kagamitan
move to sidebar
itago
Mga aksyon
Basáhon
Baguhon an source
Tanawon sa historiya
Pankagabsan
Ano an nakatukdo digdi
Katakod na mga pagbabago
Mag-upload nin file
Impormasyon kan pahina
Magkua nin pinahalipot na URL
Switch to legacy parser
Sa iba pang proyekto
Item na Wikidata
Itsura
move to sidebar
itago
Warning:
You are not logged in. Once you make an edit, a temporary account will be created for you.
Learn more
.
Log in
or
create an account
to continue receiving notifications after this account expires, and to access other features.
Rikisa nin Kontra-Ispam. Giboha na
dae
paglaogan ini!
--[[ 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
Sumaryo:
Sa pagtagama kan mga pagbabago, minauyon ka sa
Mga Kondisyon sa Paggamit
, asin ika dai na mababawi na minauyon na iluwas an saimong kontribusyon sa irarom kan
CC BY-SA 4.0 License
asin sa
GFDL
. Minauyon ka na an sarong hyperlink o URL igo nang atribusyon sa irarom kan lisensya kan Creative Commons.
This site is protected by hCaptcha and its
Privacy Policy
and
Terms of Service
apply.
JavaScript is required to continue. Turn on JavaScript in your browser settings and refresh the page.
Ipublikar an mga pagbabago
Ipahiling an mga pagbabago
Ikansela
Tabang sa pagbago
(mabukas sa bagong window)
Preview page with this template
Wikidata entities used in this page
Module:Ordinal
: Sitelink, Description: en
Mga padron na ginamit sa pahinang ini:
Plantilya:Documentation
(
baguhon
)
Plantilya:Dokumentasyon
(
baguhon
)
Module:Arguments
(
baguhon
)
Module:Documentation
(
baguhon
)
Module:Documentation/config
(
baguhon
)
Module:Documentation/styles.css
(
baguhon
)
Module:Ordinal
(
baguhon
)
Module:Ordinal/doc
(
baguhon
)
Module:Yesno
(
baguhon
)
Paghanap
Maghanap
Pigbabago an
Module
:
Ordinal
Magdugang nin mga tataramon
Magdugang nin pag-uulayan