fix: ims-mos/cct累加求和保留2位小数

This commit is contained in:
TsMask
2025-09-22 11:22:28 +08:00
parent dcd4122f83
commit 5846631d3f

View File

@@ -255,7 +255,7 @@ func (r CDREventIMS) CDRMOSHour(rmUID string, timestamp int64) []map[string]any
data = append(data, map[string]any{
"timeGroup": fmt.Sprintf("%d", hour),
"total": sums["total"],
"mosSum": sums["mosSum"],
"mosSum": float64(int(sums["mosSum"]*100)) / 100,
"mosAvg": float64(int(sums["mosSum"]/sums["total"]*100)) / 100,
})
}
@@ -327,7 +327,7 @@ func (r CDREventIMS) CDRCCTHour(rmUID string, timestamp int64) []map[string]any
data = append(data, map[string]any{
"timeGroup": fmt.Sprintf("%d", hour),
"total": sums["total"],
"cctSum": sums["cctSum"],
"cctSum": float64(int(sums["cctSum"]*100)) / 100,
"cctAvg": float64(int(sums["cctSum"]/sums["total"]*100)) / 100,
})
}