aboutsummaryrefslogtreecommitdiffstats
path: root/check-health
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-11-19 16:14:25 +0100
committerGravatar Christian Hesse <mail@eworm.de>2020-11-19 16:32:12 +0100
commit7adfd1b6703eeec91e829e386a65a60ec77e9c90 (patch)
treebca2e52be764a9242d6404d4e351e09f0319ade9 /check-health
parent34a0d4ab853ed31220b73b4ca2470778873f8108 (diff)
check-health: properly handle voltage value below one
Before this produced division by zero...
Diffstat (limited to 'check-health')
-rw-r--r--check-health3
1 files changed, 3 insertions, 0 deletions
diff --git a/check-health b/check-health
index 7d52204..d1b45d5 100644
--- a/check-health
+++ b/check-health
@@ -19,6 +19,9 @@
:local FormatVoltage do={
:local Voltage [ :tonum $1 ];
+ :if ($Voltage < 10) do={
+ :return ("0." . $Voltage . "V");
+ }
:return (($Voltage / 10) . "." . ($Voltage % ($Voltage / 10 * 10)) . "V");
}