update 环境部分bug

This commit is contained in:
P3ngSaM 2022-05-06 10:03:52 +08:00
parent 53ed5a44e9
commit 55eab99685
1 changed files with 7 additions and 2 deletions

View File

@ -54,7 +54,12 @@ def environment_co2(param):
res = dict()
res['amount'] = amount
# 每年每万元收入二氧化碳排放量
res['money_amount'] = round(amount / income, 2)
# res['money_amount'] = round(amount / income, 2)
num = 2
while round(amount / income, num) == 0.0:
num += 1
res['money_amount'] = round(amount / income, num+1)
return res
def calculate_three_year_data():
@ -152,7 +157,7 @@ def environment_energy(param):
# 每年能耗
amount = sum(total)
res = dict()
res['amount'] = amount
res['amount'] = round(amount, 2)
# 每年每万元收入能耗
res['money_amount'] = round(amount / income, 2)
return res