mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
check-health: handle formatting by picking from string
The mathematical way is more elegant, but just picking the char from
string is shorter. 😜
This commit is contained in:
parent
7adfd1b670
commit
88f9948c72
1 changed files with 1 additions and 4 deletions
|
@ -19,10 +19,7 @@
|
||||||
|
|
||||||
:local FormatVoltage do={
|
:local FormatVoltage do={
|
||||||
:local Voltage [ :tonum $1 ];
|
:local Voltage [ :tonum $1 ];
|
||||||
:if ($Voltage < 10) do={
|
:return (($Voltage / 10) . "." . [ :pick $Voltage ([ :len $Voltage ] - 1) ] . "V");
|
||||||
:return ("0." . $Voltage . "V");
|
|
||||||
}
|
|
||||||
:return (($Voltage / 10) . "." . ($Voltage % ($Voltage / 10 * 10)) . "V");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:local CheckHealthCurrent [ / system health get ];
|
:local CheckHealthCurrent [ / system health get ];
|
||||||
|
|
Loading…
Reference in a new issue