From dd44342b0d83beb5cd6dc361bda8cb6453b528c8 Mon Sep 17 00:00:00 2001 From: risen Date: Sun, 24 Mar 2024 17:36:24 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D1=80=D0=B0=D1=81=D1=87=D0=B5=D1=82=D0=B5?= =?UTF-8?q?=20=D0=BA=D0=BE=D1=8D=D1=84=D1=84=D0=B8=D1=86=D0=B8=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D0=B0=20=D0=B2=D1=8B=D0=B1=D1=80=D0=B0=D0=BA=D0=BE=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- calculating.py | 7 +++++-- texts.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/calculating.py b/calculating.py index 869bb00..877fd0f 100644 --- a/calculating.py +++ b/calculating.py @@ -3,7 +3,10 @@ def cost_prise(p, t, h, md, d, st, mk, am, post, x): t = int(t) # время печати, в минутах!!! h = float(h) # тариф электроэнергии md = float(md) # вес детали - d = float(d) # коэффициент выбраковки + if float(d) < 1: + d = 1 + else: + d = float(d) # коэффициент выбраковки st = float(st) # стоимость катушки mk = float(mk) # вес катушки am = float(am) # амортизация @@ -15,7 +18,7 @@ def cost_prise(p, t, h, md, d, st, mk, am, post, x): x = int(x) # количество экземпляров except ValueError: x = 1 - result = (abs(p) / 1000 * abs(t) / 60 * abs(h)) + (abs(md) * abs(d) * (abs(st) / abs(mk)) + abs(am) + abs(post)) * abs(x) + result = ((abs(p) / 1000) * (abs(t) / 60) * abs(h) * abs(x)) + (abs(md) * abs(d) * (abs(st) / abs(mk) * abs(x)) + abs(am) + abs(post) * abs(x)) return round(result, 2) diff --git a/texts.py b/texts.py index 2a62294..4cb6843 100644 --- a/texts.py +++ b/texts.py @@ -73,4 +73,4 @@ new_sets = (_('Задайте стоимость принтера, \n' new_marge = (_('Задайте процент желаемой наценки\n' 'в настройках (можно просто проставить ноль)')) -ver = '0.6.3' +ver = '0.6.4'