From 5b7206f8e2d7b060f8424827f74eaf013a4ab9b7 Mon Sep 17 00:00:00 2001 From: Nelson Chan <3271800+chakflying@users.noreply.github.com> Date: Mon, 9 Oct 2023 02:33:32 +0800 Subject: [PATCH] Fix: Wrong datatype for avgPing (#3724) --- server/model/monitor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 216283e16..53342e245 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1137,7 +1137,7 @@ class Monitor extends BeanModel { if (hasClients) { // Send 24 hour average ping let data24h = await uptimeCalculator.get24Hour(); - io.to(userID).emit("avgPing", monitorID, (data24h.avgPing) ? data24h.avgPing.toFixed(2) : null); + io.to(userID).emit("avgPing", monitorID, (data24h.avgPing) ? Number(data24h.avgPing.toFixed(2)) : null); // Send 24 hour uptime io.to(userID).emit("uptime", monitorID, 24, data24h.uptime);