1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

check-health: properly handle voltage value below one

Before this produced division by zero...
This commit is contained in:
Christian Hesse
2020-11-19 16:14:25 +01:00
parent 34a0d4ab85
commit 7adfd1b670

View File

@@ -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");
}