Merge branch 'ps_v5.6' into 'master'

update 环境部分bug

See merge request root/etl_tfse!22
This commit is contained in:
彭森 2022-05-06 02:04:28 +00:00
commit 4dff0a5156
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