fix: 修正KP计算中百分比值的下限为0
This commit is contained in:
1 parent
e6d26fe0e8
commit
c34a4f884d
1 file changed
+6
@@ -240,6 +240,12 @@ func saveKPIDataC(kpiReport KpiReport, index int64) int64 {
|
||||
item["value"] = 0
|
||||
item["err"] = err.Error()
|
||||
} else {
|
||||
if *v.Unit == "%" && result > 100 {
|
||||
result = 100
|
||||
}
|
||||
if *v.Unit == "%" && result < 0 {
|
||||
result = 0
|
||||
}
|
||||
item["value"] = result
|
||||
}
|
||||
KpiValues = append(KpiValues, item)
|
||||
|
||||
Reference in new issue
Block a user