Not display thousands separator symbol

I have a sensor that displays correctly as a plain number (e.g. 2312) when I check it in Developer Tools → States.

But when I use it in a card (specifically custom:gauge-card-pro, custom:modern-circular-gauge), it shows up as 2,312 with a comma as the thousands separator.

I already tried the following without any effect:

  • Converting the value to a string in various ways
  • Creating a second template sensor without device_class: power and without unit_of_measurement (so it should be treated as plain text)
  • Setting thousands_separator: “” (empty string) directly in the gauge-card-pro configuration
  • decimals: 0 is already set

The only thing that removes the comma is changing the number format manually in my user profile: Profile → General → Number format → (switch away from the locale that uses comma as thousands separator)

Is there any other solution that applies only to this sensor/card — without forcing me to change the number format globally for my entire user profile?

I would prefer not to affect how all other numbers (like energy totals, temperatures, etc.) are displayed across the dashboard.

Thanks for any ideas or workarounds!

It shows a RAW presentation - not formatted according to your settings and this entity’s accuracy settings.

Not using these cards, but some custom cards may not use standard HA functions to compose a properly formatted value, instead these cards use own formatting.

Usually it is supposed to have SAME presentation of a value in all cards. None of stock cards have a way to customize a presentation for this particular card only. Only some custom cards support this - but they may not support showing a default presentation as was said above.
In case of using a stock card - perhaps creating a template sensor with a different precision settings could be a way. As for different format settings like “use comma instead of dot” - similar, you will have to create a template sensor with altered content (keep in mind that states are always strings). As for custom cards - it’s a different story since all custom cards are different.

Can you share an example?

I have tried

- sensor:
  - name: "Net Power" 
	unique_id: net_power 
	unit_of_measurement: "W" 
	device_class: power 
	state_class: measurement 
    state: > 
      {% set cons = states('sensor.electricity_meter_power_consumption') | float(0) %} 
      {% set prod = states('sensor.electricity_meter_power_production') | float(0) %} 
      {{ ((cons - prod) * 1000) | int }}

and


  - sensor:
    - name: "Net Power Display"
      unique_id: net_power_display
      unit_of_measurement: W
      # device_class
      # state_class 
      state: >
        {% set cons = states('sensor.electricity_meter_power_consumption') | float(0) %}
        {% set prod = states('sensor.electricity_meter_power_production') | float(0) %}
        {{ (((cons - prod) * 1000) | round(0) | int | string) }}

and

{{ (states('sensor.net_power')) | round(0) | int | string }}

Converting to int will cause removing a possible fractional part (without rounding). Result will be a string.

Rounding and removing a fractional part, then unneeded conversion to int, then unneeded conversion to string.

What is your final goal? If you need to create a value equal to a difference of other sensors - you need to create a template sensor, this is correct.
If you need to get rid of fractional part - round(0) will be enough.

As I said before, just show 2077 and not 2,077 or 2.077 without changing Profile → General → Number format

(It was just an example of what I tried to get a string with a template)

I found a trick

  - type: custom:gauge-card-pro
    entity: sensor.net_power
    name: USING NOW
    unit: W
    min: 0
    max: 4000
    decimals: 0
    needle: false
    gradient: true
    gauge_type: semicircle
    segments:
      - from: 0
        color: "#444444"
      - from: 200
        color: "#FF3333"
      - from: 500
        color: "#FFAA00"
      - from: 1200
        color: "#ff0000"
    value: "{{ states('sensor.net_power') | float(0) }}"
    value_texts:
      primary: |
        {% set raw = states('sensor.net_power') | float(0) %}
        {% if raw >= 1000 %}
          {% set k = (raw / 10)  %}
          {{ k | string | replace('.', ',') }}
        {% else %}
          {{ raw }}
        {% endif %}
      primary_unit: ""
      primary_unit_before_value: false
    titles:
      main: USING NOW
      secondary: Using now