# Concatenation of two numeric values

**URL:** <https://discourse.nodered.org/t/concatenation-of-two-numeric-values/47207>\
**Category:** Dashboard\
**Created:** [15 June 2021 23:14 UTC](https://discourse.nodered.org/t/concatenation-of-two-numeric-values/47207 "2021-06-15T23:14:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![achrefnajjar](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@achrefnajjar](https://discourse.nodered.org/u/achrefnajjar)\
**Post date:** [15 June 2021 23:14 UTC](https://discourse.nodered.org/t/concatenation-of-two-numeric-values/47207/1 "2021-06-15T23:14:31Z")

</div>

hello, can anyone tell me why do i have NaN on my payload output ?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/2/c2221c04d31ff42b7ec20970fa961e674fbf6fe5.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/7/973bdc450faae8c26070c06806464d5b0aef5ccd.png)

thanks.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [15 June 2021 23:38 UTC](https://discourse.nodered.org/t/concatenation-of-two-numeric-values/47207/2 "2021-06-15T23:38:02Z")

</div>

What is button1 sending in the payload?

---

<div class="post-metadata">

**Author:** ![achrefnajjar](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@achrefnajjar](https://discourse.nodered.org/u/achrefnajjar)\
**Post date:** [15 June 2021 23:53 UTC](https://discourse.nodered.org/t/concatenation-of-two-numeric-values/47207/3 "2021-06-15T23:53:21Z")

</div>

nothing the button is just used as an inject node

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [16 June 2021 02:00 UTC](https://discourse.nodered.org/t/concatenation-of-two-numeric-values/47207/4 "2021-06-16T02:00:48Z")

</div>

So without your flow I’m just asking questions so what are the change nodes setting the payload to? Are you sending strings by any chance?

---

<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:** [16 June 2021 10:03 UTC](https://discourse.nodered.org/t/concatenation-of-two-numeric-values/47207/5 "2021-06-16T10:03:34Z")

</div>

The two change nodes will each send a separate message to the function node. The function node will only see one of those at a time, so it will only see either msg.payload1 or msg.payload2, not both at once. That means that either a or b will be undefined for each message. You can use a Join node to join the messages together, or put the two function nodes one after the other not in parallel.

See [this article in the cookbook](https://cookbook.nodered.org/basic/join-streams) for an example of how to join messages into one object.

---

<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:** [16 July 2021 10:03 UTC](https://discourse.nodered.org/t/concatenation-of-two-numeric-values/47207/6 "2021-07-16T10:03:39Z")

</div>

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