diff --git a/src/modules/oam/service/kpi.go b/src/modules/oam/service/kpi.go index 3d73d8c4..832f4c7d 100644 --- a/src/modules/oam/service/kpi.go +++ b/src/modules/oam/service/kpi.go @@ -183,11 +183,14 @@ func (s *KPI) saveKPIDataC(k oam.KPI, index int64) error { item["err"] = err.Error() } else { if v.Unit == "%" { - resultInt64 := parse.Number(result) - if resultInt64 > 100 { + resultV, ok := result.(float64) + if !ok { + resultV = 0 + } + if resultV > 100 { result = 100 } - if resultInt64 < 0 { + if resultV < 0 { result = 0 } }