# Ignition MQTT rounding floating point numbers with incoming transmissions

**URL:** <https://forum.inductiveautomation.com/t/ignition-mqtt-rounding-floating-point-numbers-with-incoming-transmissions/94070>\
**Category:** Ignition\
**Created:** [August 1, 2024, 5:09pm UTC](https://forum.inductiveautomation.com/t/ignition-mqtt-rounding-floating-point-numbers-with-incoming-transmissions/94070 "2024-08-01T17:09:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rats](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rats/32/68478_2.png) [@Rats](https://forum.inductiveautomation.com/u/Rats)\
**Post date:** [August 1, 2024, 5:09pm UTC](https://forum.inductiveautomation.com/t/ignition-mqtt-rounding-floating-point-numbers-with-incoming-transmissions/94070/1 "2024-08-01T17:09:08Z")

</div>

Hi, we're using the Cirrus Link MQTT module to receive transmissions from our sensors out in the field. I'm having a weird issue where some of the sensors get rounded by Ignition while others do not. They both appear to be transmitting correctly in Node-Red, subscribing to Ignition's MQTT broker gives the correct values, but the actual designer has rounded numbers.

I was wondering if anyone has ran into this issue before or any tips on debugging why this issue is happening? I can't have the designer rounding these numbers.

I'm attaching pictures showing Node-Red vs. the designer.

 ![image (3)](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/b/eb6a8e9c943a3e7e9cb7ed042fd4f20c55b46f5e.png)  
 ![image (1)](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/c/ec0c8915f91c54c5bf77779dbce0c7b07f160e0e.png)

 ![image (2)](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/4/44d69ccbccad438c5c7dc9dc7efa83e081702866.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/7/174af4e5ddfebc7edb88e6a549ea6efc88ee2739.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 1, 2024, 5:13pm UTC](https://forum.inductiveautomation.com/t/ignition-mqtt-rounding-floating-point-numbers-with-incoming-transmissions/94070/2 "2024-08-01T17:13:12Z")

</div>

Ignition's default number format for tags is `0.##`, which rounds **on display** in the designer. The actual floating point value is still there.

Change the tag's format property to suit your needs. Your user interfaces can use the tag's format, or substitute anything it likes, completely up to you.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 1, 2024, 7:12pm UTC](https://forum.inductiveautomation.com/t/ignition-mqtt-rounding-floating-point-numbers-with-incoming-transmissions/94070/3 "2024-08-01T19:12:32Z")

</div>

While the format string is almost certainly the "answer" in this case to the visible precision loss you're seeing, I want to call one thing out.

> [@Rats](#):
>
> I can't have the designer rounding these numbers.

Computers are rounding numbers _all the time_. Basically, everything that's not explicitly using arbitrary precision arithmetic (i.e. _some_ financial systems) is relying on bog-standard IEEE-754 floating point representation. [Including Node-RED](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding).

Double precision floating point can represent lots and lots of numbers. It cannot represent _all_ numbers.  
Just in your screenshot,  
[`0.123` is actually `0.122999999999999998224`](https://float.exposed/0x3fbf7ced916872b0)  
[`0.035` is actually `0.0350000000000000033307`](https://float.exposed/0x3fa1eb851eb851ec)  
[`0.056` is actually `0.0055999999999999999431`](https://float.exposed/0x3f76f0068db8bac7)  
And so on.

So while the format string you use for display is almost certainly going to fix the issue you're having in the immediate sense, don't be misled by the apparent precision you're seeing in Node-RED about what's actually happening internally.

---

<div class="post-metadata">

**Author:** ![Rats](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rats/32/68478_2.png) [@Rats](https://forum.inductiveautomation.com/u/Rats)\
**Post date:** [August 1, 2024, 8:08pm UTC](https://forum.inductiveautomation.com/t/ignition-mqtt-rounding-floating-point-numbers-with-incoming-transmissions/94070/4 "2024-08-01T20:08:29Z")

</div>

Thank you guys for the insight, I ended up fixing the issue before I checked back with the forum. I was not expecting such fast replies 😅  
I ended up deleting the tags and when the next MQTT transmission came in, I was getting the amount of precision I was aiming towards for the sensors that I needed.
