How to multiply a number by 1000

My object gives me a number in kW, but I would like to show it in W. So I have to multiply it by 1000. Unfortunately just changing the item format from [%.2f kW] to [%.2f W] doesn’t help - it just changes the unit, not the number.
I tried to do this with Java Formatter language but didn’t find a way. Surely I could do this with a transformation (as a rule or so), but I think there should be an easier way to solve this simple problem, maybe with the support of the OpenHab Types. Any idea?

Please post your item,
There are different solutions to your problem

OK.
This is what gives me the kW number:
Number:Power seCaliaro_Live_Production "PV Produktion [%.2f] kW" {channel="solaredge:generic:seCaliaro:live#production"}
This results eg in 1,0 kW. But what I want is 1000 W.

In your sitemap:
We are using the Unit of Measurement system
Your item definition instructs OH to treat the incoming value as a POWER value with a UNIT of kW
We can ask OH to display the value a W in the sitemap by doing:
Sitemap

Text item=seCaliaro_Live_Production label="PV Produktion [%d] W"

On the other hand,
If you want an item with a value stored multiplied by a 1000 then you will need a proxy item:

Number:Power seCalario_Live_Production_W "PV Produktion [%.2f] W"

And a rule:

rule "Kw into W"
when
    seCaliaro_Live_Production changed
then
    val production = triggeringItem.state as Number
    seCalario_Live_Production_W.postUpdate(production * 1000)
end
2 Likes

Thank you @vzorglub!
I thought of something like that - you gave me the solution, but not not as I had thought: I am handing the item values over to a database (persistence), and would have liked to have the item value multiplied, not only the appearance in the Sitemap. The Unit of Measurement system only works on Sitemaps then?
However I will do this with a rule then with the proxy item you have described. Thank you for this also.