diff --git a/repository/test.data/report.list.excel.go b/repository/test.data/report.list.excel.go index 553a00b..02aedd6 100644 --- a/repository/test.data/report.list.excel.go +++ b/repository/test.data/report.list.excel.go @@ -180,8 +180,12 @@ func ExportFTList() string { listPassQuantity := decimal.NewFromFloat(passQuantity) testQuantity, _ = reportTestQuantity.Add(listTestQuantity).Float64() passQuantity, _ = reportPassQuantity.Add(listPassQuantity).Float64() - passProbability = reportPassQuantity.Add(listPassQuantity).Div(reportTestQuantity.Add(listTestQuantity)). - Round(4).Mul(decimal.NewFromInt(100)).String() + "%" + if reportTestQuantity.Add(listTestQuantity).IsZero() { + passProbability = "0%" + } else { + passProbability = reportPassQuantity.Add(listPassQuantity).Div(reportTestQuantity.Add(listTestQuantity)). + Round(4).Mul(decimal.NewFromInt(100)).String() + "%" + } firstPassQuantity, _ = reportFirstPassQuantity.Add(listFirstPassQuantity).Float64() }