diff options
| author | ilotterytea <iltsu@alright.party> | 2025-04-22 17:19:39 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-04-22 17:19:39 +0500 |
| commit | 08e8563f94e8b46c08df4c231c838d32365d8f08 (patch) | |
| tree | e13577b2f2d9fbde64203b714516ffd6d78fc780 /src/utils.php | |
| parent | 34189e06a88ce4409a2c9652ca26f072c461233e (diff) | |
feat: show emote rating
Diffstat (limited to 'src/utils.php')
| -rw-r--r-- | src/utils.php | 6 |
1 files changed, 6 insertions, 0 deletions
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 |
