Template help - integer and commas

Hey all, I’ve got a sensor value such as:


and i want it to appear as


(i.e. no decimals and “thousands” commas added). Can anyone suggest a value template that will do this - at least just dropping the “.0” but commas would be lovely too!

Thanks in advance.


Here you go :slight_smile:

{{ "${:,.0f}".format(10283.0) }}

many thanks both!
here’s the yaml that worked for me:

- platform: template
      friendly_name: "Odometer"
      unit_of_measurement: "kms"
      value_template: >

I need something similar. I have tried to figure out how to make work for me your solution without success.
I need change values like 4852 to 48,52. Someone can help me?

Thank you in advance.

How would I apply this to a card? Specifically the entities card. I tried this, but get an error every time:

type: entities
  - entity: sensor.us_coronavirus_confirmed
    value_template: >
  - entity: sensor.us_coronavirus_current
  - entity: sensor.us_coronavirus_deaths
  - entity: sensor.us_coronavirus_recovered
title: Corona Virus Stats
state_color: true
show_header_toggle: false