Removing Decimals

Hi,

can someone tell me what the code should look like to only show the numbers in front of the comma?

Thanks.

- type: state-label
            entity: sensor.speedtest_download
            action: none
            tap_action: none
            hold_action: none
            style:
              top: 4%
              left: 94%
              font-size: 15px
              font-weight: bold
              color: black
              opacity: 0.8

You can do that with a Jinja function in a template, but you probably need to create a template sensor for the rounded value.

{{ 3.14 | round() }}

Result: 3

Sebastian

1 Like

Create a template sensor for each speedtest sensor and use the round filter.

https://jinja.palletsprojects.com/en/3.1.x/templates/#jinja-filters.round

Or, if these sensors have unique_ids - define a number of digits after a point here:

image

(a way I do not like & usually do not recommend)

2 Likes