2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

minNum/maxNum added, changed to multiple attributes (justme1968)

git-svn-id: https://svn.fhem.de/fhem/trunk@3417 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-07-14 09:15:15 +00:00
parent 3d6c0d6646
commit 429532371f

View File

@ -21,21 +21,46 @@ time_str2num($)
}
sub
min($$)
min($@)
{
my ($a,$b) = @_;
return $a if($a lt $b);
return $b;
my ($min, @vars) = @_;
for (@vars) {
$min = $_ if $_ lt $min;
}
return $min;
}
sub
max($$)
max($@)
{
my ($a,$b) = @_;
return $a if($a gt $b);
return $b;
my ($max, @vars) = @_;
for (@vars) {
$max = $_ if $_ gt $max;
}
return $max;
}
sub
minNum($@)
{
my ($min, @vars) = @_;
for (@vars) {
$min = $_ if $_ < $min;
}
return $min;
}
sub
maxNum($@)
{
my ($max, @vars) = @_;
for (@vars) {
$max = $_ if $_ > $max;
}
return $max;
}
sub
abstime2rel($)
{