From de293cd33d46c028934cc2197bbfe8853e9b5c06 Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 5 Aug 2022 12:25:02 -0400 Subject: [PATCH] Fixes #135: PHP 8.1 deprecation warning by casting float to an int --- src/Rendering/Number.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Rendering/Number.php b/src/Rendering/Number.php index 3a22981..6f9a0c8 100644 --- a/src/Rendering/Number.php +++ b/src/Rendering/Number.php @@ -151,7 +151,7 @@ public function render($data, $citationNumber = null): string */ public static function ordinal($num): string { - if (($num / 10) % 10 == 1) { + if ((int) ($num / 10) % 10 == 1) { $ordinalSuffix = CiteProc::getContext()->getLocale()->filter('terms', 'ordinal')->single; } elseif ($num % 10 == 1) { $ordinalSuffix = CiteProc::getContext()->getLocale()->filter('terms', 'ordinal-01')->single;