Hello,
I recieve from MQTT a formatted value, with the correct number of decimal (wich I don't know). I try to add only the unit to this value.
I tried with the format :
for a received value of 25.36
{ kN} gives : " kN25"
0{ kN} gives : "25 kN"
0.0{ kN} gives : "25.4 kN"
How can I just add the unit without modifying the value ?
Hello Francois,
if you always receive two decimal places you could use 0.00{ kN}.
Hello Matthias,
Thank you for reply. Unfortunally, I don't know the number of decimal places, but I need to display the value I recieve (with x decimals) and add the unit.
I changed the way to recieve MQTT values. I now recieve string value, with the correct decimal places and the unit. The display is correct, but now I have problem when I want to get conditions on display.
For example, I recieve a string '12.34 bar'. and I want to change the forecolor of the display if the value is under 0. It looks impossible for me.
Do I have to publish raw value and string ? this is not really an optimized communication.
Thank you for your help
Hello Francois,
is it an option to just add a label with the unti, e.g. "bar", next to the textbox?
Hello Matthias,
Thank you for reply.
it can be a solution, but not very convenient. As example, I have that kind of dipslay for a pump and I have around 10 pumps.
This one is a SVG, but it doesn't change my problem !
I think I 'm gonna display strings and for the conditions (forecolors), I 'll send a bit from the PLC to indicate a faulty value.
Thank you for your help.
Thank you for your feedback,
we'll take your suggestion of using the format property to add a unit without formatting the value itself into consideration.



