# Convert a string output for numerical output

**URL:** <https://discourse.nodered.org/t/convert-a-string-output-for-numerical-output/63822>\
**Category:** General\
**Created:** [12 June 2022 14:34 UTC](https://discourse.nodered.org/t/convert-a-string-output-for-numerical-output/63822 "2022-06-12T14:34:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bruno1](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@Bruno1](https://discourse.nodered.org/u/Bruno1)\
**Post date:** [12 June 2022 14:34 UTC](https://discourse.nodered.org/t/convert-a-string-output-for-numerical-output/63822/1 "2022-06-12T14:34:43Z")

</div>

Hi everyone!  
I have a problem in my node red, and i can´t resolve it.  
My output is a string such as you can see and i want that output will be just a numerical output.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/d/8d98b07fad32c23633be7f301d9f47e8dbd6effa.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/a/2a38e54ff20018154bfda237a2e402a13f8002ae.png)

---

<div class="post-metadata">

**Author:** ![mickym2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mickym2/32/36128_2.png) [@mickym2](https://discourse.nodered.org/u/mickym2)\
**Post date:** [12 June 2022 14:54 UTC](https://discourse.nodered.org/t/convert-a-string-output-for-numerical-output/63822/2 "2022-06-12T14:54:54Z")

</div>

It seems that your function node is the black hole. may be you should show how the input is and what topic you want to create as SQL statement. I would probably use a template node to build the SQL statement instead of a function node.

---

<div class="post-metadata">

**Author:** ![ScheepersJohan](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/scheepersjohan/32/39556_2.png) [@ScheepersJohan](https://discourse.nodered.org/u/ScheepersJohan)\
**Post date:** [12 June 2022 15:21 UTC](https://discourse.nodered.org/t/convert-a-string-output-for-numerical-output/63822/3 "2022-06-12T15:21:03Z")

</div>

Tempmed, Tempmin, Temmax, are all int(numbers).

The question is more what do you want to do with the output from the sql query (I assume that is the output from it)

---

<div class="post-metadata">

**Author:** ![mickym2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mickym2/32/36128_2.png) [@mickym2](https://discourse.nodered.org/u/mickym2)\
**Post date:** [12 June 2022 15:33 UTC](https://discourse.nodered.org/t/convert-a-string-output-for-numerical-output/63822/4 "2022-06-12T15:33:34Z")

</div>

I guess he wants to specify a condition using one of the values within the array. But without knowing how the SQLstatement shouldlook like, we can only speculate.

---

<div class="post-metadata">

**Author:** ![mickym2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mickym2/32/36128_2.png) [@mickym2](https://discourse.nodered.org/u/mickym2)\
**Post date:** [12 June 2022 16:22 UTC](https://discourse.nodered.org/t/convert-a-string-output-for-numerical-output/63822/5 "2022-06-12T16:22:28Z")

</div>

If the out put should just numerical values - then I would inject the payload into a split node (may be twice - one to split the array, second to split the object), which generates 3 messages with numerical values and topics from the keys

---

<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:** [11 August 2022 16:22 UTC](https://discourse.nodered.org/t/convert-a-string-output-for-numerical-output/63822/6 "2022-08-11T16:22:50Z")

</div>

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