fuel/core — Issue #583: I made this function for ordinals; could be useful on Inflector maybe
Author: Altreus
Created: 2011-10-16 13:23:19+00:00
State: open

Returns th, st, nd or rd based on the input number. Could be better: doesn't support locale

```php
function th($d) {
$th = 'th';
if (abs($d) < 10 || abs($d) > 20) {
if ($d % 10 == 1) $th = 'st';
if ($d % 10 == 2) $th = 'nd';
if ($d % 10 == 2) $th = 'rd';
}
return $th;
}
```