Hi,
In order to get the Modbus decimal to Eng units you need to use this formula according to the docs.
Example Flow:
[{"id":"e408ef72.58812","type":"inject","z":"94ab22aa.035ba","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"22048","payloadType":"num","x":210,"y":1040,"wires":[["dda5ae4b.3055b"]]},{"id":"dda5ae4b.3055b","type":"function","z":"94ab22aa.035ba","name":"","func":"// pt100 range -50 ~ +150\n\n\nlet decimal = msg.payload\nlet celsius = ( decimal / 65535) * 200 - 50 \n\nmsg.celsius = celsius\n\nlet fahrenheit = (celsius * 9/5) + 32\n\nmsg.fahrenheit = fahrenheit\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":450,"y":1040,"wires":[["a7beba74.31897"]]},{"id":"a7beba74.31897","type":"debug","z":"94ab22aa.035ba","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":670,"y":1040,"wires":[]},{"id":"1443a3c7.aabf1c","type":"comment","z":"94ab22aa.035ba","name":"modbus decimal","info":"","x":210,"y":1000,"wires":[]}]
Code in Function :
// pt100 range -50 ~ +150
let decimal = msg.payload // msg.payload[0] when linked to modbus node
let celsius = ( decimal / 65535) * 200 - 50
let fahrenheit = (celsius * 9/5) + 32
msg.celsius = celsius
msg.fahrenheit = fahrenheit
return msg;
Result :

[EDIT]
By the way .. what modbus addresses did you read in your screenshot above ? 40001 ?
Did you try reading 31 and 32 also ? Your device could be sending the engineering units in those directly which makes the above code unnecessary 