# How to convert a number that is 0 to a decimal 0.0?

**URL:** <https://discourse.nodered.org/t/how-to-convert-a-number-that-is-0-to-a-decimal-0-0/67289>\
**Category:** General\
**Created:** [3 September 2022 10:50 UTC](https://discourse.nodered.org/t/how-to-convert-a-number-that-is-0-to-a-decimal-0-0/67289 "2022-09-03T10:50:19Z")\
**Posts on this page:** 4\
**Page:** 3

<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:** [4 September 2022 11:19 UTC](https://discourse.nodered.org/t/how-to-convert-a-number-that-is-0-to-a-decimal-0-0/67289/41 "2022-09-04T11:19:32Z")

</div>

> [@questuk](#):
>
> Do you use a particular GUI to look at the data ?

No. I use command line, or query examiner in Grafana, or an Influx In node node-red.

---

<div class="post-metadata">

**Author:** ![questuk](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/questuk/32/4059_2.png) [@questuk](https://discourse.nodered.org/u/questuk)\
**Post date:** [4 September 2022 14:16 UTC](https://discourse.nodered.org/t/how-to-convert-a-number-that-is-0-to-a-decimal-0-0/67289/42 "2022-09-04T14:16:34Z")

</div>

> [@Colin](#):
>
> using Template Literals

```auto
const Data_sequence = `( device,data) values('${device}','${payload}')`
const topic = `INSERT INTO Energy ${Data_sequence}`

```

Just tried this and all seems to work.  
I am using it from now on.  
Much easier to understand !

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:** [4 September 2022 14:35 UTC](https://discourse.nodered.org/t/how-to-convert-a-number-that-is-0-to-a-decimal-0-0/67289/43 "2022-09-04T14:35:26Z")

</div>

It is a fairly recent addition to javascript which is why the older js tutorials and web search hits don't use it. Probably some older browsers still don't support it, but that isn't an issue in node-red because it is interpreted by nodejs on the node-red server, not in the browser.

---

<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:** [3 November 2022 14:35 UTC](https://discourse.nodered.org/t/how-to-convert-a-number-that-is-0-to-a-decimal-0-0/67289/44 "2022-11-03T14:35:45Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/how-to-convert-a-number-that-is-0-to-a-decimal-0-0/67289.md?page=2)
