From 0c7a411c1f08f297e80fb43c4fbf630c057d2bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Tue, 3 Jan 2023 00:21:12 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20nekone=C4=8Dn=C3=A9=20desetin=C3=A9=20ro?= =?UTF-8?q?zvoje?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/models/odevzdavatko.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seminar/models/odevzdavatko.py b/seminar/models/odevzdavatko.py index 82a75bc6..2d937a41 100644 --- a/seminar/models/odevzdavatko.py +++ b/seminar/models/odevzdavatko.py @@ -123,8 +123,8 @@ class Hodnoceni(bm.SeminarModelBase): # TODO najít správné místo @staticmethod - def inverze_vzorecku_na_prepocet(body, resitelu): - return decimal.Context(prec=1).create_decimal_from_float(body * (resitelu + 2) / 3) + def inverze_vzorecku_na_prepocet(body: decimal.Decimal, resitelu) -> decimal.Decimal: + return round(body * (resitelu + 2) / 3, 1) @property def body_celkem(self):