diff options
author | Christian Hesse <mail@eworm.de> | 2020-11-19 16:14:25 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2020-11-19 16:32:12 +0100 |
commit | 7adfd1b6703eeec91e829e386a65a60ec77e9c90 (patch) | |
tree | bca2e52be764a9242d6404d4e351e09f0319ade9 | |
parent | 34a0d4ab853ed31220b73b4ca2470778873f8108 (diff) |
check-health: properly handle voltage value below one
Before this produced division by zero...
-rw-r--r-- | check-health | 3 |
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"); } |