<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://www.vigyanwiki.in/index.php?action=history&amp;feed=atom&amp;title=Module%3AOrdinal</id>
	<title>Module:Ordinal - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.vigyanwiki.in/index.php?action=history&amp;feed=atom&amp;title=Module%3AOrdinal"/>
	<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:Ordinal&amp;action=history"/>
	<updated>2026-04-27T07:42:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:Ordinal&amp;diff=110783&amp;oldid=prev</id>
		<title>Indicwiki: 1 revision imported from :alpha:Module:Ordinal</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:Ordinal&amp;diff=110783&amp;oldid=prev"/>
		<updated>2023-03-17T03:51:27Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported from &lt;a href=&quot;https://alpha.indicwiki.in/index.php?title=Module:Ordinal&quot; class=&quot;extiw&quot; title=&quot;alpha:Module:Ordinal&quot;&gt;alpha:Module:Ordinal&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:21, 17 March 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Indicwiki</name></author>
	</entry>
	<entry>
		<id>https://www.vigyanwiki.in/index.php?title=Module:Ordinal&amp;diff=110782&amp;oldid=prev</id>
		<title>alpha&gt;Indicwiki: Created page with &quot;--[[     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/sandbo...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.vigyanwiki.in/index.php?title=Module:Ordinal&amp;diff=110782&amp;oldid=prev"/>
		<updated>2022-08-12T06:44:19Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;--[[     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/sandbo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[  &lt;br /&gt;
 &lt;br /&gt;
This template will add the appropriate ordinal suffix to a given integer.&lt;br /&gt;
 &lt;br /&gt;
Please do not modify this code without applying the changes first at&lt;br /&gt;
Module:Ordinal/sandbox and testing.&lt;br /&gt;
 &lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local yesno     = require('Module:Yesno') -- boolean value interpretation&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
This function converts an integer value into a numeral followed by ordinal indicator.&lt;br /&gt;
The output string might contain HTML tags.&lt;br /&gt;
 &lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Ordinal|ordinal|1=|2=|sup=}}&lt;br /&gt;
{{#invoke:Ordinal|ordinal}} - uses the caller's parameters&lt;br /&gt;
 &lt;br /&gt;
Parameters&lt;br /&gt;
    1: Any number or string.&lt;br /&gt;
    2: Set to &amp;quot;d&amp;quot; if the module should display &amp;quot;d&amp;quot; instead of &amp;quot;nd&amp;quot; and &amp;quot;rd&amp;quot;.&lt;br /&gt;
    sup: Set to yes/no to toggle superscript ordinal suffix.&lt;br /&gt;
]]&lt;br /&gt;
function p.ordinal(frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
    if args[1] == nil then&lt;br /&gt;
        args = frame:getParent().args&lt;br /&gt;
    end&lt;br /&gt;
    if args[1] == nil then&lt;br /&gt;
    	args[1] = &amp;quot;{{{1}}}&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    return p._ordinal(args[1], (args[2] == 'd'), yesno(args.sup))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._ordinal(n, d, sup)&lt;br /&gt;
	local x = tonumber(mw.ustring.match(n, &amp;quot;(%d*)%W*$&amp;quot;))&lt;br /&gt;
	local suffix = &amp;quot;th&amp;quot;&lt;br /&gt;
	-- If tonumber(n) worked:&lt;br /&gt;
	if x then&lt;br /&gt;
		local mod10 = math.abs(x) % 10&lt;br /&gt;
		local mod100 = math.abs(x) % 100&lt;br /&gt;
		if     mod10 == 1 and mod100 ~= 11 then&lt;br /&gt;
			suffix = &amp;quot;st&amp;quot;&lt;br /&gt;
		elseif mod10 == 2 and mod100 ~= 12 then&lt;br /&gt;
			if d then suffix = &amp;quot;d&amp;quot; else suffix = &amp;quot;nd&amp;quot; end&lt;br /&gt;
		elseif mod10 == 3 and mod100 ~= 13 then&lt;br /&gt;
			if d then suffix = &amp;quot;d&amp;quot; else suffix = &amp;quot;rd&amp;quot; end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if sup then&lt;br /&gt;
		suffix = &amp;quot;&amp;lt;sup&amp;gt;&amp;quot; .. suffix .. &amp;quot;&amp;lt;/sup&amp;gt;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return n .. suffix&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>alpha&gt;Indicwiki</name></author>
	</entry>
</feed>