# IoT Scale and Conversion

**URL:** <https://discourse.nodered.org/t/iot-scale-and-conversion/2586>\
**Category:** General\
**Created:** [27 August 2018 00:20 UTC](https://discourse.nodered.org/t/iot-scale-and-conversion/2586 "2018-08-27T00:20:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![achalaggarwal](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@achalaggarwal](https://discourse.nodered.org/u/achalaggarwal)\
**Post date:** [27 August 2018 00:20 UTC](https://discourse.nodered.org/t/iot-scale-and-conversion/2586/1 "2018-08-27T00:20:43Z")

</div>

Hello,  
I'm new to Node Red and need some assistance. I have been working with scale that is connected to cloud and i'm getting the weight readings from the scale.  
What i'm trying to achieve is convert the weight obtained from the scale into number of units for the item. For eg, i know the weight of a certain item is 2kg, so if the scale returns a value of 10kg, the function should be able to convert that into number of units, in this case it will be 5.  
Can someone assist please

---

<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:** [27 August 2018 00:56 UTC](https://discourse.nodered.org/t/iot-scale-and-conversion/2586/2 "2018-08-27T00:56:44Z")

</div>

Take a look at the 'range' node  
or you could use a 'change' node with a JSONata expression (the one that looks like J:) using `payload/2`

---

<div class="post-metadata">

**Author:** ![achalaggarwal](https://avatars.discourse-cdn.com/v4/letter/a/e68b1a/32.png) [@achalaggarwal](https://discourse.nodered.org/u/achalaggarwal)\
**Post date:** [27 August 2018 06:49 UTC](https://discourse.nodered.org/t/iot-scale-and-conversion/2586/3 "2018-08-27T06:49:56Z")

</div>

Thanks, really appreciated
