IoT Scale and Conversion

#1

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

#2

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

#3

Thanks, really appreciated