Popular recipes tagged "ordinals"http://code.activestate.com/recipes/tags/ordinals/2010-02-04T12:54:27-08:00ActiveState Code Recipesformat a number as an ordinal (Python)
2010-02-04T12:54:27-08:00Serdar Tumgorenhttp://code.activestate.com/recipes/users/4171495/http://code.activestate.com/recipes/576888-format-a-number-as-an-ordinal/
<p style="color: grey">
Python
recipe 576888
by <a href="/recipes/users/4171495/">Serdar Tumgoren</a>
(<a href="/recipes/tags/number/">number</a>, <a href="/recipes/tags/numbers/">numbers</a>, <a href="/recipes/tags/numerals/">numerals</a>, <a href="/recipes/tags/ordinals/">ordinals</a>).
Revision 10.
</p>
<p>This function converts 0 and <em>positive</em> integers (or their string representations) to their ordinal values. For example, it would convert 0 to "0th", 1 to "1st", 2 to "2nd", 3 to "3rd" and so on.</p>