Skip to content

Commit 7daa58d

Browse files
committed
Added rounding to two decimal places as default for numeric values.
1 parent 7c98726 commit 7daa58d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

public/config/default-display-config.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ _color: '#AAAAAA'
2424
_labelTemplates:
2525
- ''
2626
- ''
27-
- '{{state}}{{unit_of_measurement}}'
27+
- |
28+
{% if (state | float('f')) == 'f' -%}
29+
{{ state }}
30+
{% else -%}
31+
{{ state | round(2) }}{{unit_of_measurement}}
32+
{% endif %}
2833
_states:
2934
unavailable:
3035
color: '#FF6F91'

0 commit comments

Comments
 (0)