max
Returns the largest of some numbers or of a list of numbers.
Keyboard Maestro: max
Details #
max(number, number, ...) takes one or more arguments and returns a number. Give the numbers separately, or give a single list: max(4, 9, 2) and max([4, 9, 2]) are both 9. Numeric text counts as a number.
Parameters #
Takes at least 1 argument.
{{ max(a, b, …) }}
Examples #
max(3, 1, 2)→
3max(scores)→
9| Sample variable | Value |
|---|---|
scores | [4, 9, 2] |
max(0, balance)→
0| Sample variable | Value |
|---|---|
balance | -5 |
Gotchas #
An empty list is an error:
max() needs at least one number. An item that isn't a number is an error:max() needs numbers, got text.