mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-19 15:26:59 +00:00
Update template min/max/average documentation (#20448)
This commit is contained in:
parent
06e8d3e899
commit
906b9af95c
@ -614,6 +614,9 @@ The numeric functions and filters will not fail if the input is not a valid numb
|
|||||||
- `atan(value, default)` will return the arcus tangent of the input. If `value` can't be converted to a `float`, returns the `default` value, or if omitted `value`. Can be used as a filter.
|
- `atan(value, default)` will return the arcus tangent of the input. If `value` can't be converted to a `float`, returns the `default` value, or if omitted `value`. Can be used as a filter.
|
||||||
- `atan2(y, x, default)` will return the four quadrant arcus tangent of y / x. If `y` or `x` can't be converted to a `float`, returns the `default` value, or if omitted `value`. Can be used as a filter.
|
- `atan2(y, x, default)` will return the four quadrant arcus tangent of y / x. If `y` or `x` can't be converted to a `float`, returns the `default` value, or if omitted `value`. Can be used as a filter.
|
||||||
- `sqrt(value, default)` will return the square root of the input. If `value` can't be converted to a `float`, returns the `default` value, or if omitted `value`. Can be used as a filter.
|
- `sqrt(value, default)` will return the square root of the input. If `value` can't be converted to a `float`, returns the `default` value, or if omitted `value`. Can be used as a filter.
|
||||||
|
- `max([x, y, ...])` will obtain the largest item in a sequence. Uses the same parameters as the built-in [max](https://jinja.palletsprojects.com/en/latest/templates/#jinja-filters.max) filter.
|
||||||
|
- `min([x, y, ...])` will obtain the smallest item in a sequence. Uses the same parameters as the built-in [min](https://jinja.palletsprojects.com/en/latest/templates/#jinja-filters.min) filter.
|
||||||
|
- `average([x, y, ...])` will return the average value of the sequence. Can be used as a filter.
|
||||||
- `e` mathematical constant, approximately 2.71828.
|
- `e` mathematical constant, approximately 2.71828.
|
||||||
- `pi` mathematical constant, approximately 3.14159.
|
- `pi` mathematical constant, approximately 3.14159.
|
||||||
- `tau` mathematical constant, approximately 6.28318.
|
- `tau` mathematical constant, approximately 6.28318.
|
||||||
@ -621,9 +624,6 @@ The numeric functions and filters will not fail if the input is not a valid numb
|
|||||||
- `round(precision, "floor", default)` will always round down to `precision` decimals
|
- `round(precision, "floor", default)` will always round down to `precision` decimals
|
||||||
- `round(precision, "ceil", default)` will always round up to `precision` decimals
|
- `round(precision, "ceil", default)` will always round up to `precision` decimals
|
||||||
- `round(1, "half", default)` will always round to the nearest .5 value. `precision` should be 1 for this mode
|
- `round(1, "half", default)` will always round to the nearest .5 value. `precision` should be 1 for this mode
|
||||||
- Filter `[x, y, ...] | max` will obtain the largest item in a sequence.
|
|
||||||
- Filter `[x, y, ...] | min` will obtain the smallest item in a sequence.
|
|
||||||
- Filter `[x, y, ...] | average` will return the average value of the sequence.
|
|
||||||
- Filter `value_one|bitwise_and(value_two)` perform a bitwise and(&) operation with two values.
|
- Filter `value_one|bitwise_and(value_two)` perform a bitwise and(&) operation with two values.
|
||||||
- Filter `value_one|bitwise_or(value_two)` perform a bitwise or(\|) operation with two values.
|
- Filter `value_one|bitwise_or(value_two)` perform a bitwise or(\|) operation with two values.
|
||||||
- Filter `ord` will return for a string of length one an integer representing the Unicode code point of the character when the argument is a Unicode object, or the value of the byte when the argument is an 8-bit string.
|
- Filter `ord` will return for a string of length one an integer representing the Unicode code point of the character when the argument is a Unicode object, or the value of the byte when the argument is an 8-bit string.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user