From 7adfd1b6703eeec91e829e386a65a60ec77e9c90 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 19 Nov 2020 16:14:25 +0100 Subject: check-health: properly handle voltage value below one Before this produced division by zero... --- check-health | 3 +++ 1 file changed, 3 insertions(+) (limited to 'check-health') 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"); } -- cgit v1.2.3-70-g09d2