# How to divide JSONATA payload term?

**URL:** <https://discourse.nodered.org/t/how-to-divide-jsonata-payload-term/60644>\
**Category:** General\
**Created:** [1 April 2022 10:41 UTC](https://discourse.nodered.org/t/how-to-divide-jsonata-payload-term/60644 "2022-04-01T10:41:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kuhnino](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuhnino/32/58898_2.png) [@kuhnino](https://discourse.nodered.org/u/kuhnino)\
**Post date:** [1 April 2022 10:41 UTC](https://discourse.nodered.org/t/how-to-divide-jsonata-payload-term/60644/1 "2022-04-01T10:41:16Z")

</div>

I have collected data thru "serial in" and forwarded that to an MQTT message. Tx to all here who hellped me already. Problem now is some of the values, e.g. for the temperature are 10 times higher.  
So instead of 20 degree it shows 200 to me inside MQTT.

Is there a possibility to divide and/or multiplicate payloads?

Picture shows what I´m doing right now

to be divided by 10

 ![2022-04-01 12_33_56-Node-RED _ 192.168.178.9](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/e/ce7750d8cdf52976175dc19f229c7fde4aafa9ba.png)

and another one needs the same but multiplicated by 1000

I believe this is nothing spectacular, but haven´t found the point

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [1 April 2022 10:47 UTC](https://discourse.nodered.org/t/how-to-divide-jsonata-payload-term/60644/2 "2022-04-01T10:47:40Z")

</div>

Why don’t you correct the data after the serial in and before the MQTT node?

---

<div class="post-metadata">

**Author:** ![mickym2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mickym2/32/36128_2.png) [@mickym2](https://discourse.nodered.org/u/mickym2)\
**Post date:** [1 April 2022 11:33 UTC](https://discourse.nodered.org/t/how-to-divide-jsonata-payload-term/60644/3 "2022-04-01T11:33:53Z")

</div>

I do not understand the problem, why just divide by 10 or multiply by 1000.

```auto
$number(payload[7])/10

```

or

```auto
$number(payload[7])*1000

```

---

<div class="post-metadata">

**Author:** ![kuhnino](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuhnino/32/58898_2.png) [@kuhnino](https://discourse.nodered.org/u/kuhnino)\
**Post date:** [1 April 2022 11:45 UTC](https://discourse.nodered.org/t/how-to-divide-jsonata-payload-term/60644/4 "2022-04-01T11:45:24Z")

</div>

Tx Mickyym2  
That´s what I assumed : easy if you know how.  
Tx so much

---

<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:** [15 April 2022 11:46 UTC](https://discourse.nodered.org/t/how-to-divide-jsonata-payload-term/60644/5 "2022-04-15T11:46:25Z")

</div>

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