fixed divide by zero issues in equipmentsaving
parent
57a4bf377b
commit
cd6237d57c
|
@ -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 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 subtotals_in_kgco2e_saving_sum > 0 else '-'
|
||||
|
||||
current_row_number += 1
|
||||
|
||||
|
|
Loading…
Reference in New Issue