I’m using a template in a custom card (here vacuum card).
stats:
default:
- entity_id: sensor.mahroboter_messerqualitat
value_template: '{{ "{0:_.0f}".format(1230) }}'
unit: '%'
subtitle: without replace
- entity_id: sensor.mahroboter_messerqualitat
value_template: '{{ "{0:_.0f}".format(1230).replace("_",".") }}'
unit: '%'
subtitle: with replace
Result
The 0 is not displayed.
This is (currently) only happending, if last digit is 0, compare to this
Any ideas on this, as it is working in developer tools, other cards, etc. but the card author says, that it is not a problem of the card, because is rendered via the HA backend and that the template is getting sent to the backend and the result is displayed.
The the DOM it is shown as
1 post - 1 participant