Divide KNX item value by 1000

Hi,

can you help me to divide an item by 1000? I’m struggling with the syntax here I think:

Thing/Channel:

Type number: PWR_Hzg_ZaehlerGes “PWR Heizung Gesamtverbrauch” [ga=“13.001:<3/7/100”]

Item:

Number PWR_Hzg_ZaehlerGes “Stromzähler Wärmepmpe [JS(divideBy1000.js):%s kWh]” { channel=“knx:device:bridge:generic:PWR_Hzg_ZaehlerGes”}

divideBy1000.js:

(function(i) {
return parseFloat(i) / 1000;
})(input)

the division works, but how can I show the number with two decimals? Also on PaperUi shows the item value as “JS(divideBy1000.js):130kWh”

Thanks,
Klayman

Just add toFixed(num_of_decimals)

Thanks. It worked, although it seems that PaperUI can’t show the transformed value under the default “Control” section.

That is perfectly right if you added the transformation to the sitemap. The control page is more or less to show that the item you have setup is working.