Perhaps if you share your flow or at least the original data set it will be easier for someone to suggest a solution. Kind Regards.
--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/3449e008-8f43-4559-b931-717d64788ef9%40googlegroups.com.
HI Garry,JSONata can only do maths on Number types and provides the $number function to help convert types - it does, however, have some limitations.($number(payload[1]) + (256 *$number(payload[0]))) / 1.2The above expression will work if you are passing it an array of strings - such as ["10", "20"].However it appears to not work on Buffer types - as Buffer is not a JSON type. I will talk to the JSONata project about Buffer support, but that doesn't help you right now.So, if your data is in a Buffer, you'll need to use a Function to do the work:msg.payload = (parseInt(msg.payload[1]) + (256*parseInt(msg.payload[0])))/1.2;return msg;
On 16 February 2018 at 15:08, AIOT MAKER <aiot....@gmail.com> wrote:
Perhaps if you share your flow or at least the original data set it will be easier for someone to suggest a solution. Kind Regards.
--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/aa2b65be-1721-43be-8b07-5975bbabd2a4%40googlegroups.com.