Browse Source

Core now has ordinal()

Mark Scherer 10 years ago
parent
commit
c89393f985
1 changed files with 0 additions and 26 deletions
  1. 0 26
      src/Utility/Number.php

+ 0 - 26
src/Utility/Number.php

@@ -243,32 +243,6 @@ class Number extends CakeNumber {
 	}
 
 	/**
-	 * Returns the English ordinal suffix (th, st, nd, etc) of a number.
-	 *
-	 * echo NumberLib::ordinal(2); // "nd"
-	 * echo NumberLib::ordinal(10); // "th"
-	 * echo NumberLib::ordinal(33); // "rd"
-	 *
-	 * @param int $number
-	 * @return string
-	 */
-	public static function ordinal($number) {
-		if ($number % 100 > 10 && $number % 100 < 14) {
-			return 'th';
-		}
-		switch ($number % 10) {
-			case 1:
-				return 'st';
-			case 2:
-				return 'nd';
-			case 3:
-				return 'rd';
-			default:
-				return 'th';
-		}
-	}
-
-	/**
 	 * Can compare two float values
 	 *
 	 * @link http://php.net/manual/en/language.types.float.php