fixed DivisionUndefined issues in combinedequipmentsaving

pull/10/MERGE
13621160019@163.com 2021-03-07 11:16:50 +08:00
parent 30522bc75a
commit 75015e1417
2 changed files with 8 additions and 8 deletions

View File

@ -329,9 +329,9 @@ def generate_excel(report,
ws['D' + str(current_row_number)].font = name_font
ws['D' + str(current_row_number)].alignment = c_c_alignment
ws['D' + str(current_row_number)].border = f_border
ws['D' + str(current_row_number)] = \
str(round(reporting_period_data['subtotals_in_kgce_saving'][i] /
subtotals_in_kgce_saving_sum * 100, 2)) + '%'
ws['D' + str(current_row_number)] = str(round(reporting_period_data['subtotals_in_kgce_saving'][i] /
subtotals_in_kgce_saving_sum * 100, 2)) + '%'\
if abs(subtotals_in_kgce_saving_sum) > 0 else '-'
current_row_number += 1
@ -398,9 +398,9 @@ def generate_excel(report,
ws['D' + str(current_row_number)].font = name_font
ws['D' + str(current_row_number)].alignment = c_c_alignment
ws['D' + str(current_row_number)].border = f_border
ws['D' + str(current_row_number)] = \
str(round(reporting_period_data['subtotals_in_kgco2e_saving'][i] /
subtotals_in_kgco2e_saving_sum * 100, 2)) + '%'
ws['D' + str(current_row_number)] = str(round(reporting_period_data['subtotals_in_kgco2e_saving'][i] /
subtotals_in_kgco2e_saving_sum * 100, 2)) + '%'\
if abs(subtotals_in_kgco2e_saving_sum) > 0 else '-'
current_row_number += 1

View File

@ -331,7 +331,7 @@ def generate_excel(report,
ws['D' + str(current_row_number)].border = f_border
ws['D' + str(current_row_number)] = str(round(reporting_period_data['subtotals_in_kgce_saving'][i] /
subtotals_in_kgce_saving_sum * 100, 2)) + '%' \
if subtotals_in_kgce_saving_sum > 0 else '-'
if abs(subtotals_in_kgce_saving_sum) > 0 else '-'
current_row_number += 1
@ -400,7 +400,7 @@ def generate_excel(report,
ws['D' + str(current_row_number)].border = f_border
ws['D' + str(current_row_number)] = str(round(reporting_period_data['subtotals_in_kgco2e_saving'][i] /
subtotals_in_kgco2e_saving_sum * 100, 2)) + '%' \
if subtotals_in_kgco2e_saving_sum > 0 else '-'
if abs(subtotals_in_kgco2e_saving_sum) > 0 else '-'
current_row_number += 1