# Read a number in an array

**URL:** <https://discourse.nodered.org/t/read-a-number-in-an-array/68718>\
**Category:** General\
**Created:** [8 October 2022 12:52 UTC](https://discourse.nodered.org/t/read-a-number-in-an-array/68718 "2022-10-08T12:52:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiaa931](https://avatars.discourse-cdn.com/v4/letter/k/6de8d8/32.png) [@kiaa931](https://discourse.nodered.org/u/kiaa931)\
**Post date:** [8 October 2022 12:52 UTC](https://discourse.nodered.org/t/read-a-number-in-an-array/68718/1 "2022-10-08T12:52:50Z")

</div>

Hey!  
I want to use the number in the array extracted from an csv file for a calculation. I convereted the object to an array but the number is in between " ", which doesnt allow me to read roperly  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/5/a594cd794de66becfe1c863845547f1be7d9dd9f.png)  
How can I get rid of the " " so it will like this  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/2/426250edd93151b9aad385fa1f650ab5f87c559b.png)  
(Note. the second picture got a different value. added just to show how I need it)

Thanks heaps

---

<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:** [8 October 2022 13:05 UTC](https://discourse.nodered.org/t/read-a-number-in-an-array/68718/2 "2022-10-08T13:05:03Z")

</div>

You can convert it in a function node using  
`msg.payload = Number(msg.payload)`.

How did you convert it to an array, it may be possible to do the conversion at the same time.

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [8 October 2022 13:48 UTC](https://discourse.nodered.org/t/read-a-number-in-an-array/68718/3 "2022-10-08T13:48:32Z")

</div>

Or if you used the csv node, set it to parse numeric values.

[edit]  
I see i responded in another thread. If you had responded there I would of said  
use  
`$split($$.payload.col1, ",").$number($)`

---

<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:** [7 December 2022 13:48 UTC](https://discourse.nodered.org/t/read-a-number-in-an-array/68718/4 "2022-12-07T13:48:50Z")

</div>

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