# How can I convert a buffer \[4\] into a number value?

**URL:** https://discourse.nodered.org/t/how-can-i-convert-a-buffer-4-into-a-number-value/3506
**Category:** General
**Created:** [27 September 2018 16:10 UTC](https://discourse.nodered.org/t/how-can-i-convert-a-buffer-4-into-a-number-value/3506 "2018-09-27T16:10:57Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aabbas](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@aabbas](https://discourse.nodered.org/u/aabbas)
#### Post date: [27 September 2018 16:10 UTC](https://discourse.nodered.org/t/how-can-i-convert-a-buffer-4-into-a-number-value/3506/1 "2018-09-27T16:10:57Z")

</div>

Hello,  
I have KES - KNX Energy Saver - REF: ZN1IO-KES. I like to get the energy consumption on my node red-dashboad. But i have problem with it. I got this message on my debug window ( knx: write : msg.payload : Object

object

srcphy: "3.1.55"

dstgad: "11/7/20"

value: buffer[4][raw]

0: 0x0

1: 0x0

2: 0x0

3: 0x0 )  
How can I convert a buffer [4] into a number value?

---

<div class="post-metadata">

### Author: ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)
#### Post date: [27 September 2018 18:06 UTC](https://discourse.nodered.org/t/how-can-i-convert-a-buffer-4-into-a-number-value/3506/2 "2018-09-27T18:06:55Z")

</div>

Here is a nice reference for [reading/writing buffers](https://www.w3schools.com/nodejs/ref_buffer.asp) on the W3Schools site.

For instance, if you just want to replace the 4-byte payload buffer with its 32-bit signed  
big-endian integer value, try this:

```auto
msg.payload = msg.payload.readInt32BE();
return msg;

```
