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

**URL:** <https://discourse.nodered.org/t/how-to-display-number-as-13-0-instead-of-13-in-a-text-node/42161>\
**Category:** FAQs\
**Created:** [6 March 2021 16:44 UTC](https://discourse.nodered.org/t/how-to-display-number-as-13-0-instead-of-13-in-a-text-node/42161 "2021-03-06T16:44:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tsaavedrA](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@tsaavedrA](https://discourse.nodered.org/u/tsaavedrA)\
**Post date:** [6 March 2021 16:44 UTC](https://discourse.nodered.org/t/how-to-display-number-as-13-0-instead-of-13-in-a-text-node/42161/1 "2021-03-06T16:44:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gerry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gerry/32/21604_2.png) [@gerry](https://discourse.nodered.org/u/gerry)\
**Post date:** [6 March 2021 16:53 UTC](https://discourse.nodered.org/t/how-to-display-number-as-13-0-instead-of-13-in-a-text-node/42161/2 "2021-03-06T16:53:56Z")

</div>

Try the .toFix command and set decimal to 1

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 March 2021 17:11 UTC](https://discourse.nodered.org/t/how-to-display-number-as-13-0-instead-of-13-in-a-text-node/42161/3 "2021-03-06T17:11:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tsaavedrA](https://avatars.discourse-cdn.com/v4/letter/t/71c47a/32.png) [@tsaavedrA](https://discourse.nodered.org/u/tsaavedrA)\
**Post date:** [6 March 2021 19:55 UTC](https://discourse.nodered.org/t/how-to-display-number-as-13-0-instead-of-13-in-a-text-node/42161/4 "2021-03-06T19:55:01Z")

</div>

> [@Colin](#):
>
> {{msg.payload | number: 1}}

That worked great!, Thanks

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 March 2021 21:30 UTC](https://discourse.nodered.org/t/how-to-display-number-as-13-0-instead-of-13-in-a-text-node/42161/5 "2021-03-06T21:30:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [20 March 2021 21:31 UTC](https://discourse.nodered.org/t/how-to-display-number-as-13-0-instead-of-13-in-a-text-node/42161/6 "2021-03-20T21:31:56Z")

</div>

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