# Infinity as a Number

**URL:** <https://discourse.nodered.org/t/infinity-as-a-number/51736>\
**Category:** General\
**Created:** [30 September 2021 23:22 UTC](https://discourse.nodered.org/t/infinity-as-a-number/51736 "2021-09-30T23:22:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [30 September 2021 23:22 UTC](https://discourse.nodered.org/t/infinity-as-a-number/51736/1 "2021-09-30T23:22:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [30 September 2021 23:25 UTC](https://discourse.nodered.org/t/infinity-as-a-number/51736/2 "2021-09-30T23:25:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [30 September 2021 23:25 UTC](https://discourse.nodered.org/t/infinity-as-a-number/51736/3 "2021-09-30T23:25:52Z")

</div>

Is there a workaround?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [30 September 2021 23:38 UTC](https://discourse.nodered.org/t/infinity-as-a-number/51736/4 "2021-09-30T23:38:26Z")

</div>

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

```auto
msg.payload = Infinity
return msg

```

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

---

<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:** [14 October 2021 23:39 UTC](https://discourse.nodered.org/t/infinity-as-a-number/51736/5 "2021-10-14T23:39:15Z")

</div>

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