From d6075b1e624151a41f749b6e078ee4accb09e588 Mon Sep 17 00:00:00 2001 From: P3ngSaM <61768364+P3ngSaM@users.noreply.github.com> Date: Thu, 10 Mar 2022 17:03:43 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=B8=85=E6=B4=97=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rating/scripts/report/company_profile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rating/scripts/report/company_profile.py b/rating/scripts/report/company_profile.py index e640cc9..902acd2 100644 --- a/rating/scripts/report/company_profile.py +++ b/rating/scripts/report/company_profile.py @@ -336,7 +336,10 @@ def calculate_tuple(param1, param2, param3, param4): amount += item['amount'] except TypeError: amount += 0 - concentration = round(amount / param3 * 100, 2) + try: + concentration = round(amount / param3 * 100, 2) + except ZeroDivisionError: + concentration = 0 if concentration > 60: result['concentration'] = '高' elif concentration > 40: