From efc9f911cf37e74393da951a77a54e04348fcad0 Mon Sep 17 00:00:00 2001 From: jh_peng Date: Mon, 25 Nov 2024 15:09:47 +0800 Subject: [PATCH] =?UTF-8?q?V0=20FT=E8=AE=B0=E5=BD=95=20FT=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=AF=BC=E5=87=BA=E8=89=AF=E7=8E=87=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=95=B0=E4=B8=BA0=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- repository/test.data/report.list.excel.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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() }