From 08e8563f94e8b46c08df4c231c838d32365d8f08 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Tue, 22 Apr 2025 17:19:39 +0500 Subject: feat: show emote rating --- src/utils.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/utils.php') diff --git a/src/utils.php b/src/utils.php index 325603b..a11fa16 100644 --- a/src/utils.php +++ b/src/utils.php @@ -58,7 +58,13 @@ function format_timestamp(int $timestamp_secs) return "$days day" . ($days > 1 ? "s" : ""); } } + function clamp(int $current, int $min, int $max): int { return max($min, min($max, $current)); +} + +function in_range(float $value, float $min, float $max): bool +{ + return $min <= $value && $value <= $max; } \ No newline at end of file -- cgit v1.2.3