/** * Transforming int values into ordinal numbers (1st, 3rd, ...). * When using HTML, you can use <sup>, as well. * * @param $num (INT) - the number to be suffixed. * @param $sup (BOOL) - whether to wrap the suffix in a superscript (<sup>) tag on output. * @return string ordinal */ public static function ordinalNumber($num = 0, $sup = false) { $ordinal = NumberLib::ordinal($num); return $sup ? $num . '<sup>' . $ordinal . '</sup>' : $num . $ordinal; }