Infinity as a Number

When using an "inject node" with msg.payload set to Number in the drop down menu, if the value is set to Infinity Node-RED will place a Triangle on that node and state that the property is invalid. Every time I try to deploy, it will warn me:

The workspace contains some nodes that are not properly configured:

[Functions] Infinity (inject)

Are you sure you want to deploy?

This is because the validation on the field is looking for numerical digits. It doesn't know about Infinity as a valid number.

Is there a workaround?

Use a function node after the inject node with the code:

msg.payload = Infinity
return msg

Although you may want to consider using Number.MAX_SAFE_INTEGER instead of infinity.

1 Like

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