<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FBatternut%2FOrdinal</id>
	<title>Module:Sandbox/Batternut/Ordinal - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FBatternut%2FOrdinal"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Batternut/Ordinal&amp;action=history"/>
	<updated>2026-04-17T18:45:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Sandbox/Batternut/Ordinal&amp;diff=145188&amp;oldid=prev</id>
		<title>imported&gt;Legoktm: Replace Module:No globals with require( &quot;strict&quot; )</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/Batternut/Ordinal&amp;diff=145188&amp;oldid=prev"/>
		<updated>2022-10-23T20:59:55Z</updated>

		<summary type="html">&lt;p&gt;Replace &lt;a href=&quot;/research/Module:No_globals&quot; title=&quot;Module:No globals&quot;&gt;Module:No globals&lt;/a&gt; with require( &amp;quot;strict&amp;quot; )&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- vim: set noexpandtab ft=lua ts=4 sw=4:&lt;br /&gt;
require(&amp;#039;strict&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local o = {}&lt;br /&gt;
local debug = false&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
makeOrdinal&lt;br /&gt;
&lt;br /&gt;
This function returns an ordinal string for the target number.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Ordinal|makeOrdinal|target_num|}}&lt;br /&gt;
&lt;br /&gt;
Parameters&lt;br /&gt;
    1: The string whose length to report&lt;br /&gt;
    2: the language code&lt;br /&gt;
&lt;br /&gt;
If invoked using named parameters, Mediawiki will automatically remove any leading or&lt;br /&gt;
trailing whitespace from the target string.  &lt;br /&gt;
]]&lt;br /&gt;
function o.makeOrdinal( target_num, langcode )&lt;br /&gt;
	if langcode == &amp;#039;fr&amp;#039; then&lt;br /&gt;
		if target_num == 1 then&lt;br /&gt;
	    	return target_num .. &amp;#039;er&amp;#039;&lt;br /&gt;
    	else&lt;br /&gt;
			return target_num .. &amp;#039;e&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	elseif langcode == &amp;#039;en&amp;#039; then&lt;br /&gt;
		if target_num == 11 or target_num == 12 or target_num == 13 then&lt;br /&gt;
	    	return target_num .. &amp;#039;th&amp;#039;&lt;br /&gt;
		elseif target_num % 10 == 1 then&lt;br /&gt;
			return target_num .. &amp;#039;st&amp;#039;&lt;br /&gt;
		elseif target_num % 10 == 2 then&lt;br /&gt;
			return target_num .. &amp;#039;nd&amp;#039;&lt;br /&gt;
		elseif target_num % 10 == 3 then&lt;br /&gt;
			return target_num .. &amp;#039;rd&amp;#039;&lt;br /&gt;
		else&lt;br /&gt;
			return target_num .. &amp;#039;th&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return target_num .. &amp;#039;.&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return o&lt;/div&gt;</summary>
		<author><name>imported&gt;Legoktm</name></author>
	</entry>
</feed>