From 81e5f2ae2c0769688397b9ce98f8805f6981695d Mon Sep 17 00:00:00 2001 From: Vladimir Barinov Date: Sun, 10 Oct 2021 00:05:20 +0300 Subject: [PATCH] Profile: Refactor rating bar. Again. @celestora is not going to follow my idea kek --- Web/Models/Entities/User.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Web/Models/Entities/User.php b/Web/Models/Entities/User.php index 02ef1e26..95ee1c48 100644 --- a/Web/Models/Entities/User.php +++ b/Web/Models/Entities/User.php @@ -399,7 +399,10 @@ class User extends RowModel $total = max(100 - $incompleteness + $this->getRating(), 0); if(ovkGetQuirk("profile.rating-bar-behaviour") === 0) - $percent = intval(substr(strval($total), -2)); + if ($total >= 100) + $percent = round(($total / 10**strlen(strval($total))) * 100, 0); + else + $percent = min($total, 100); else $percent = min($total, 100);