Entering buffer non-decimal values using change node

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

but it doesn't work (for valid reasons)

I can achieve it using a function node

but that's always my tool of last resort :slight_smile:

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

Or another way?

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

which while not as easy as binary for bit masks is somewhat easier than decimal

1 Like

Sticking quotes around the value works for binary as well :slight_smile:

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

PR Raised - fix buffer viewer to handle 0b style binary by dceejay · Pull Request #4393 · node-red/node-red · GitHub

1 Like

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