update 环境部分bug
This commit is contained in:
parent
53ed5a44e9
commit
55eab99685
|
@ -54,7 +54,12 @@ def environment_co2(param):
|
||||||
res = dict()
|
res = dict()
|
||||||
res['amount'] = amount
|
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
|
return res
|
||||||
|
|
||||||
def calculate_three_year_data():
|
def calculate_three_year_data():
|
||||||
|
@ -152,7 +157,7 @@ def environment_energy(param):
|
||||||
# 每年能耗
|
# 每年能耗
|
||||||
amount = sum(total)
|
amount = sum(total)
|
||||||
res = dict()
|
res = dict()
|
||||||
res['amount'] = amount
|
res['amount'] = round(amount, 2)
|
||||||
# 每年每万元收入能耗
|
# 每年每万元收入能耗
|
||||||
res['money_amount'] = round(amount / income, 2)
|
res['money_amount'] = round(amount / income, 2)
|
||||||
return res
|
return res
|
||||||
|
|
Loading…
Reference in New Issue