add the ordinal suffix (st,nd,rd,th)

@param integer $num the number to ordinalify

@return string
438965
public static function ordinal($num)
	{
		$ext = 'th';
		if ($num < 11 || $num > 13) {
			switch ($num % 10) {
				case 1:
					$ext = 'st';
					break;
				case 2:
					$ext = 'nd';
					break;
				case 3:
					$ext = 'rd';
			}
		}
		return $num.$ext;
	}
1103072
public function idivn($num) {
        assert(is_numeric($num) && $num != 0);
        $this->bi = $this->bi->div(intval($num));
        return $this;
    }
588874
function addOrdinalNumberSuffix(num) {
    var j = num % 10,
        k = num % 100;
    if (j == 1 && k != 11) {
        return num + "st";
    }
    if (j == 2 && k != 12) {
        return num + "nd";
    }
    if (j == 3 && k != 13) {
        return num + "rd";
    }
    return num + "th";
}
1044447
private function numeric($num): void
    {
        //调节为整数
        $num = intval(round($num));

        //与id字段匹配
        $this->sql = " id=$num";
        $this->prepare = " id=?";
        $this->param = [$num];
    }
779426
public function clean($num)
    {
        $num = (float) $num;

        if ($this->min !== null && $num < $this->min) {
            $num = (float) $this->min;
        }

        if ($this->max !== null && $num > $this->max) {
            $num = (float) $this->max;
        }

        if ($this->forceInt) {
            $num = (int) $num;
        }

        return $num;
    }
274530
public function shorten($num) {
		$str = '';

		while ($num > 0) {
			$str = $this->alphabet[($num % $this->base)] . $str;
			$num = (int) ($num / $this->base);
		}

		return $str;
	}
381925
def _increment_numeric_suffix(s):
        """"""
        if re.match(r".*\d+$", s):
            return re.sub(r"\d+$", lambda n: str(int(n.group(0)) + 1), s)
        return s + "_2"
766174
function toMusicXML($num) {
        $out = '';

        $out .= '<clef number="'.$num.'">';
        $out .= '<sign>'.$this->sign.'</sign>';
        $out .= '<line>'.$this->line.'</line>';
        if ($this->octaveChange != 0) {
            $out .= '<clef-octaveChange>'.$this->octave-change.'</clef-octaveChange>';
        }
        $out  .= '</clef>';

        return $out;
    }
1063710
public function nth( $nth = null ) {

		$this->do_hook( 'nth', $nth );

		return $this->data->nth( $nth );
	}
148779
protected function convert($num)
    {
        if ($num instanceof NumericTypeInterface) {
            return $num;
        }
        if (is_numeric($num)) {
            return $this->calcEngine->convertNumeric($num);
        }

        $type = (is_object($num) ? get_class($num) : gettype($num));
        throw new \BadMethodCallException('No solution for unknown type: ' . $type);
    }
1261161
public function isubn($num) {
        assert(is_numeric($num));
        $this->bi = $this->bi->sub(intval($num));
        return $this;
    }
462478
def strnum(prefix: str, num: int, suffix: str = "") -> str:
    
    return "{}{}{}".format(prefix, num, suffix)
1169674
public function setNumber($num)
    {
        $num = (int) $num;
        if ($num <= 0) {
            throw new \InvalidArgumentException(sprintf(
                    'Invalid Number "%s" - Polygon Coordinates Number Must Be '
                    . 'Greater Than Zero'
                    , $num
            ));
        }
        $count = count($this->getCoordinates());
        if ($num > $count) {
            throw new \OutOfBoundsException(sprintf(
                    'Given Coodrinates Number "%s" Is Greater Than The Actual '
                    . 'Coordinates Array Size "%s"'
                    , $num, $count
            ));
        }
        $this->count = $num;

        return $this;
    }
366478
public static function intTo36Hex($num)
    {
        $num = intval($num);
        if ($num <= 0)
            return 0;
        $charArr = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z');
        $char = '';
        do {
            $key = ($num - 1) % 36;
            $char = $charArr[$key] . $char;
            $num = floor(($num - $key) / 36);
        } while ($num > 0);
        return $char;
    }
334115
public function drop( $num ) {
		if ( $num > $this->count() ) {
			$num = $this->count();
		}

		return $this->slice( $num, $this->count() );
	}
218468
public static function ordinalize($number, $locale = 'en')
    {
        $ordinal = new Ordinal($number, $locale);
     
        return (string) ($ordinal->isPrefix()) ? $ordinal.$number : $number.$ordinal;
    }
750897
public static function toRoman($num)
  {
    $num = (int)$num;
    switch($num){
      case 1:
        $roman = 'I';
        break;
      case 2:
        $roman = 'II';
        break;
      case 3:
        $roman = 'III';
        break;
      case 4:
        $roman = 'IV';
        break;
      case 5:
        $roman = 'V';
        break;
      case 6:
        $roman = 'VI';
        break;
      case 7:
        $roman = 'VII';
        break;
      case 8:
        $roman = 'VIII';
        break;
      case 9:
        $roman = 'IX';
        break;
      case 10:
        $roman = 'X';
        break;
      default:
        $roman = (string)$num;
        break;
    }
    
    return $roman;
  }