Warning: Invalid argument supplied for foreach() in /home/jihswbiz/public_html/t6.gwilt.org/refDox.php on line 212
Docs-ordinate

 

ReLoad

Keys


Functions

arraybrowsercolorcookiedatetimeDBdebugdeviceDSTequiverrorflagsfontformatgeo
holidayhtmlisjsonmathparsePHPprintsearchsortstringtabletexttracetype
VOTDweatherxml

Function  ordinate   Lines 1587-1614 (27 lines) file  utils.php   Last mod: Fri 2021-05-14 21:45:07

function ordinate $n$s=false )
        {
#-k     string format
#       convert a number to its ordinal string

        
$s1 $s2 '';
        if (
$s) { $s1 '<sup>'$s2 '</sup>'; }
        if ((
$n >= 11) and ($n <= 13))
                { 
$r 'th'; }
        else
                {
                
$x $n 10;
                switch (
$x)
                        {
                case 
1$r 'st';
                        break;
                case 
2$r 'nd';
                        break;
                case 
3$r 'rd';
                        break;
                default: 
$r 'th';
                        break;
                        }
                }

        return 
$n $s1 $r $s2;
        }

?>