From 8242c4ceab6b68817c1fcb701a3a7f3bedae99d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Glorieux?= Date: Thu, 3 Aug 2023 21:04:42 +0200 Subject: [PATCH] #159 "2nd" as en edition --- src/Rendering/Number.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Rendering/Number.php b/src/Rendering/Number.php index 6f9a0c8..dd41504 100644 --- a/src/Rendering/Number.php +++ b/src/Rendering/Number.php @@ -151,6 +151,9 @@ public function render($data, $citationNumber = null): string */ public static function ordinal($num): string { + if (!is_numeric($num)) { + return $num; + } if ((int) ($num / 10) % 10 == 1) { $ordinalSuffix = CiteProc::getContext()->getLocale()->filter('terms', 'ordinal')->single; } elseif ($num % 10 == 1) {