Dashboard Entities: Different format for currency values

The formatting in an Entities card is different between a sensor value and an attribute value.
See following example:


In the dashboard, the sensor value is shown with a comma “,” (the point is used to separate thousends, if the value is big enough) - this is how I expect it (Format n.nnn,dd)
image

The attribute value is shown with a point as comma. (Format nnnn.dd)

type: entities
title: Lieferübersicht
entities:
  - type: section
    label: täglich
  - entity: sensor.ed_ref_return_daily
    name: heute
  - type: divider
  - type: attribute
    entity: sensor.ed_ref_return_daily
    attribute: last_period
    name: gestern
    suffix: kWh

I expect the attribute to be shown in the same format than the sensor value.

It is not clear to me what this has to do with currency values (it is about energy?), but I think this might be because Home Assistant is probably always using points as decimal sign in the background, independent of how it is set to be in the UI.
To be sure: did you set the Number format correctly in your HA Profile?

Anyhow, this attribute value probably is a string value representing the value calculated in the background.
Do you see any other attribute values of other entities that are using a comma as decimal sign?

What you could try is creating an extra template sensor that converts that attribute value from the string (with a point as decimal sign) into a float value (with a comma as decimal sign).
Something like this:

template:
  - sensor:
      - name: Energy last period
        unit_of_measurement: "kWh"
        state: "{{ state_attr('sensor.ed_ref_return_daily', 'last_period') | replace('.', ',') | float(0) }}"

This extra sensor can now be used in the Entities card.