How to display number as 13.0 instead of 13 in a text node

I am trying to display battery voltage in a text node but I would like it to display to 1 decimal point. The msg.payload going into the text node is a number but when I try to use .toString in a function node it passes a function instead of a string. Any suggestions

Try the .toFix command and set decimal to 1

The reason toString passes the function is that that is the name of the function. You want to call the function so it should be toString().
There is no need to do that however. In the text node Value Format field put
{{msg.payload | number: 1}}
which will tell it to expect a number and show it with 1 decimal places.

That worked great!, Thanks

I think that is the third time today I have posted basically the same answer. Twice for gauges and now for a text node.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.