From f13c759c0e43c80b1c4af8f644c6bbefc6159f41 Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Wed, 12 Nov 2025 19:44:48 -0500 Subject: [PATCH] Improve reading of operator expression Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- pdns/dnsdistdist/html/local.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pdns/dnsdistdist/html/local.js b/pdns/dnsdistdist/html/local.js index 4f9f125509..aec38feb89 100644 --- a/pdns/dnsdistdist/html/local.js +++ b/pdns/dnsdistdist/html/local.js @@ -158,16 +158,16 @@ $(document).ready(function() { if(!gdata["cpu-sys-msec"]) gdata=data; - var cpu=((1.0*data["cpu-sys-msec"]+1.0*data["cpu-user-msec"] - 1.0*gdata["cpu-sys-msec"]-1.0*gdata["cpu-user-msec"])/10.0); + var cpu=((1*data["cpu-sys-msec"] + 1*data["cpu-user-msec"]) - (1*gdata["cpu-sys-msec"] + 1*gdata["cpu-user-msec"]))/10.0; $("#cpu").text(cpu.toFixed(2)); var qps=1.0*data["queries"]-1.0*gdata["queries"]; $("#qps").text(qps.toFixed(2)); $("#server-policy").text(data["server-policy"]); - var servfailps=1.0*data["servfail-responses"]-1.0*gdata["servfail-responses"]; + var servfailps=(1*data["servfail-responses"]) - (1*gdata["servfail-responses"]); - var totpcache=1.0*data["cache-hits"]-1.0*gdata["cache-hits"]+1.0*data["cache-misses"]-1.0*gdata["cache-misses"]; + var totpcache=(1*data["cache-hits"] + 1*data["cache-misses"]) - (1*gdata["cache-hits"] + 1*gdata["cache-misses"]); var hitrate=0; if(totpcache > 0) { hitrate=100.0*(data["cache-hits"]-1.0*gdata["cache-hits"])/totpcache; -- 2.47.3