Rounding watt to Kwatt

Is it possible to insert a rounding?
Let me explain:
I have this item in watts, I would like to transform it into KW, rounding up so that if it shows 9 watts, 0 kw is written

item=TeslaPowerwall_Instanteous_Solar_Power							label= "Fotovoltaico Totale Tesla [%.0f W]"		icon="solarplant" 

I think you need to explain a bit more exactly what you want.

Do you want it to always show the unit in kw? Just change your format from W to kW

Do you want it to dynamically show W or kW depending on a range? You can do that using script transformation and have it do whatever you want based on any criteria.

Just need to describe that criteria in detail

sorry you are right…
now in OH i see this:
Immagine 2023-09-03 113814

i need to see this only in Kw:

For that, just set your item label to Fotovoltaico Totale Tesla [%.1f kW]

1 Like

It’s working!!! great!!! tnx a lot!