V0 FT记录 FT记录导出良率计算测试数为0特殊处理
This commit is contained in:
parent
32b5e326e7
commit
efc9f911cf
@ -180,8 +180,12 @@ func ExportFTList() string {
|
|||||||
listPassQuantity := decimal.NewFromFloat(passQuantity)
|
listPassQuantity := decimal.NewFromFloat(passQuantity)
|
||||||
testQuantity, _ = reportTestQuantity.Add(listTestQuantity).Float64()
|
testQuantity, _ = reportTestQuantity.Add(listTestQuantity).Float64()
|
||||||
passQuantity, _ = reportPassQuantity.Add(listPassQuantity).Float64()
|
passQuantity, _ = reportPassQuantity.Add(listPassQuantity).Float64()
|
||||||
|
if reportTestQuantity.Add(listTestQuantity).IsZero() {
|
||||||
|
passProbability = "0%"
|
||||||
|
} else {
|
||||||
passProbability = reportPassQuantity.Add(listPassQuantity).Div(reportTestQuantity.Add(listTestQuantity)).
|
passProbability = reportPassQuantity.Add(listPassQuantity).Div(reportTestQuantity.Add(listTestQuantity)).
|
||||||
Round(4).Mul(decimal.NewFromInt(100)).String() + "%"
|
Round(4).Mul(decimal.NewFromInt(100)).String() + "%"
|
||||||
|
}
|
||||||
|
|
||||||
firstPassQuantity, _ = reportFirstPassQuantity.Add(listFirstPassQuantity).Float64()
|
firstPassQuantity, _ = reportFirstPassQuantity.Add(listFirstPassQuantity).Float64()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user