Assuming you don’t want to change the string stored in your Item, and only change the string displayed in your UI.
Your JS would need to convert string to number, format with two decimal places, and return the result for display.
In response to DM - no I don’t know exactly how to do that.
You need to install the transformation service if you haven’t already.
You call the js within your Item label in this way for display only
String myMysteryItem "My text label [JS(twopoints.js):%s]"
That says to pass the Item state as a string to your script in conf/transforms.
The script will be something like (untested)
// i is the string value passed in
var d = parseFloat(i);
// get the string as a decimal
d = Math.round(d * 100);
d = d / 100;
// get to two decimal places
// transforms always return that as a string
I’m not sure if that works with comma as decimal separator instead of point
Well, transformation works for everyone else.
If I introduce a deliberate error in the transform filename, I get an error in openhab.log at the time of display on UI. Maybe try that to see if your transformation service is working.