# Encoding 4-byte signed value

**URL:** https://discourse.nodered.org/t/encoding-4-byte-signed-value/4720
**Category:** General
**Created:** [9 November 2018 11:50 UTC](https://discourse.nodered.org/t/encoding-4-byte-signed-value/4720 "2018-11-09T11:50:39Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [9 November 2018 12:36 UTC](https://discourse.nodered.org/t/encoding-4-byte-signed-value/4720/2 "2018-11-09T12:36:27Z")

</div>

did the answer you were given last time you asked this question not work?

> [@How can I convert a buffer \[4\] into a number value?](https://discourse.nodered.org/t/how-can-i-convert-a-buffer-4-into-a-number-value/3506/2):
>
> 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: msg.payload = msg.payload.readInt32BE(); return msg;

---

_[View the full topic](https://discourse.nodered.org/t/encoding-4-byte-signed-value/4720)._
