Label cell vs. floating point display vs. state description - how to?

OH: ver 4.1.1
Platform: Windows 11

Hello I have defined temperature sensor with channel temperature and everything is ok like on the screen:


with link defined with state description “%.1f %unit%” like following:

it seems everything it works good, but…

I created “Label cell” on the page, and you can see the screen:
LabelCell_04

the value in the Label cell is set as:

and I see still temperature as 21.88889 C - why! ther is so much numbers after “.” mark it should be only 21.9 C.

How to around float number to 1 decimal place in the Label cell?

.state is the raw unformatted Item state. .displayState is the state formatted according to the state description pattern.

See Building Pages - Components & Widgets | openHAB

I hate how you answer me :wink: I thought my problem was complicated, I agonize and agonize, and your brilliant answer in one sentence solves the problem.

You are a genius OH!

Thank you so much @rlkoshak !!!

1 Like