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