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

global-functions: $EitherOr: properly handle time values

This commit is contained in:
Christian Hesse
2023-09-15 09:46:28 +02:00
parent 2a10f43acc
commit 5349c9b52e

View File

@@ -309,6 +309,9 @@
:if ([ :typeof $1 ] = "num") do={
:return [ $IfThenElse ($1 != 0) $1 $2 ];
}
:if ([ :typeof $1 ] = "time") do={
:return [ $IfThenElse ($1 > 0s) $1 $2 ];
}
:return [ $IfThenElse ([ :len [ :tostr $1 ] ] > 0) $1 $2 ];
}