# Math::Max

Verarbeitung
Math::Max
I1
I2
I3
I4
O

# Eingänge

IDKürzelNameTypStandardBeschreibung
input_1I1input_1NUMBER-9223372036854775807
input_2I2input_2NUMBER-9223372036854775807
input_3I3input_3NUMBER-9223372036854775807
input_4I4input_4NUMBER-9223372036854775807

# Ausgänge

IDKürzelNameTypStandardBeschreibung
outputOoutputNUMBER0

# Quellcode

Volang-Quellcode anzeigen
i = 1
empty = -9223372036854775807
max = empty
while (i<=4) {
    input = input::get(str::fmt("input_{}", i))
    // check if input was provided any value by comparing to a default value of min(i64)
    hasValue = input != empty
    if (hasValue) {
        if (input > max or max == empty) {
            max = input
        }
    }
    i += 1
}

fn round2decimal(value) {
    return math::round(100.0 * value) / 100.0
}

output::set("output", round2decimal(max))
Erfahren Sie, wie der Logikbaustein Math::Max funktioniert, wann Sie ihn einsetzen und wie Sie ihn in Ihrer Voldeno Smart-Home-Automatisierung konfigurieren.