# Working between Floating Point and Int. data types

**URL:** <https://discourse.nodered.org/t/working-between-floating-point-and-int-data-types/22677>\
**Category:** General\
**Created:** [5 March 2020 20:48 UTC](https://discourse.nodered.org/t/working-between-floating-point-and-int-data-types/22677 "2020-03-05T20:48:16Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![jfehl](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jfehl](https://discourse.nodered.org/u/jfehl)\
**Post date:** [26 March 2020 12:47 UTC](https://discourse.nodered.org/t/working-between-floating-point-and-int-data-types/22677/23 "2020-03-26T12:47:26Z")

</div>

It's perfect!! Right on the money. Scale head is reporting 15765 and debug:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/f/3fae7e0cbe295d433bd4fb7d2151c2d7fe75a833.png)

Thanks again

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 March 2020 13:30 UTC](https://discourse.nodered.org/t/working-between-floating-point-and-int-data-types/22677/24 "2020-03-26T13:30:07Z")

</div>

I am not sure you need to the function node at all. As an experiment replace the function node I posted with a Change node configured as below, basically it just moves the buffer into the payload and passes it on the conversion function. The conversion function will accept a buffer, though I haven't checked the bytes are in the right order. If it doesn't work then go back to the function node.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/2/323b4ac97fd2dd06b78984e38d51ea3514bd99b1.png)

---

<div class="post-metadata">

**Author:** ![jfehl](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jfehl](https://discourse.nodered.org/u/jfehl)\
**Post date:** [26 March 2020 13:44 UTC](https://discourse.nodered.org/t/working-between-floating-point-and-int-data-types/22677/25 "2020-03-26T13:44:11Z")

</div>

This seems to give me:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/7/b7506050e8bef70f2d39c4a5b1f930d1a2b9a32e.png)

from the `IEEE-754 to float` function.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 March 2020 13:50 UTC](https://discourse.nodered.org/t/working-between-floating-point-and-int-data-types/22677/26 "2020-03-26T13:50:48Z")

</div>

OK, I see what is happening and it needs a function to fix it, so best to stick with the one that works.

---

<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:** [9 April 2020 13:50 UTC](https://discourse.nodered.org/t/working-between-floating-point-and-int-data-types/22677/27 "2020-04-09T13:50:48Z")

</div>

Closed on 9 April 2020 13:50 UTC

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

[Previous page](https://discourse.nodered.org/t/working-between-floating-point-and-int-data-types/22677.md?page=1)
