# Entering buffer non-decimal values using change node

**URL:** <https://discourse.nodered.org/t/entering-buffer-non-decimal-values-using-change-node/82296>\
**Category:** General\
**Created:** [24 October 2023 10:22 UTC](https://discourse.nodered.org/t/entering-buffer-non-decimal-values-using-change-node/82296 "2023-10-24T10:22:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [24 October 2023 10:22 UTC](https://discourse.nodered.org/t/entering-buffer-non-decimal-values-using-change-node/82296/1 "2023-10-24T10:22:03Z")

</div>

During my MQTT fun project, I'm working with bit patterns so it would be nice to be able to use a change node to do this  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/7/27fb8cd646248ec9863680152a40b1d9f1a3d328.png)

but it doesn't work (for valid reasons)

I can achieve it using a function node  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/4/e47f8aaff28ef8e2ea44694cfb49eb3d8f4dcec4.png)

but that's always my tool of last resort 🙂

Is it possible to do with some simple JSONata within the change node?

Or another way?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [24 October 2023 11:05 UTC](https://discourse.nodered.org/t/entering-buffer-non-decimal-values-using-change-node/82296/2 "2023-10-24T11:05:33Z")

</div>

you can use 0x rather than 0b ... eg

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/9/39aec8c68c162bffac25d0139aadd1d3d4cec29e.png)  
which while not as easy as binary for bit masks is somewhat easier than decimal

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [24 October 2023 16:37 UTC](https://discourse.nodered.org/t/entering-buffer-non-decimal-values-using-change-node/82296/3 "2023-10-24T16:37:10Z")

</div>

Sticking quotes around the value works for binary as well 🙂

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

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [24 October 2023 21:21 UTC](https://discourse.nodered.org/t/entering-buffer-non-decimal-values-using-change-node/82296/4 "2023-10-24T21:21:42Z")

</div>

Hmm... but doesn't display correctly in the expanded buffer editor page.. whereas the hex does... ☹

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/9/49117b258590860bde1c1dd2a1a83bc53eab63d4.png)

PR Raised - [fix buffer viewer to handle 0b style binary by dceejay · Pull Request #4393 · node-red/node-red · GitHub](https://github.com/node-red/node-red/pull/4393)

---

<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 November 2023 21:22 UTC](https://discourse.nodered.org/t/entering-buffer-non-decimal-values-using-change-node/82296/5 "2023-11-07T21:22:09Z")

</div>

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