Color part of a number

If you wanted to make the last 3 numbers smaller, you could use a markdown card like this:

type: markdown
content: >-
  {% set value = states('sensor.whatever') | int %}

  {{ (value / 1000) | int }}<small>{{ value % 1000 }}</small>

However, it seems like you cannot use inline css to make the text red. You might want to take a look at card-mod to add custom css. I’m sure there’s probably a better way, but this seemed to me like the easiest solution.

1 Like