Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 102800

Template is cutting a digit 0 but should not

$
0
0

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

image

The 0 is not displayed.

This is (currently) only happending, if last digit is 0, compare to this

image

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

image

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 102800

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>