From 2b92a2a010158c41e435b3007657490cb4fa8dc7 Mon Sep 17 00:00:00 2001 From: Koen van Leeuwen Date: Wed, 25 Sep 2019 22:20:34 +0200 Subject: [PATCH] Make low power readings more precise --- public/javascripts/dash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/dash.js b/public/javascripts/dash.js index 527c433..23cc6d2 100644 --- a/public/javascripts/dash.js +++ b/public/javascripts/dash.js @@ -275,7 +275,7 @@ var dash = { refreshRealtimeDisplay: function(realtime) { - var power = Math.round(('power_mw' in realtime) ? (realtime.power_mw/1000) : realtime.power); + var power = (('power_mw' in realtime) ? (realtime.power_mw/1000) : realtime.power).toPrecision(3); var current = (('current_ma' in realtime) ? (realtime.current_ma/1000) : realtime.current).toFixed(2); var voltage = Math.round(('voltage_mv' in realtime) ? (realtime.voltage_mv/1000) : realtime.voltage);