# Writing to Document Tag float value being rounded

**URL:** <https://forum.inductiveautomation.com/t/writing-to-document-tag-float-value-being-rounded/103740>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [March 15, 2025, 8:53pm UTC](https://forum.inductiveautomation.com/t/writing-to-document-tag-float-value-being-rounded/103740 "2025-03-15T20:53:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [March 15, 2025, 8:53pm UTC](https://forum.inductiveautomation.com/t/writing-to-document-tag-float-value-being-rounded/103740/1 "2025-03-15T20:53:15Z")

</div>

In vision, writing to Document Tag will truncate the decimal part:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/5/c57728ac1953b8a1330fabdbf5aa1431b7d10db0.png)

Opening Tag:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/6/c6bf8c4ba05e140c09a681e30aab6d9652b36e40.png)

Why oh why?

Ignition Version 8.1.21

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [March 15, 2025, 9:01pm UTC](https://forum.inductiveautomation.com/t/writing-to-document-tag-float-value-being-rounded/103740/2 "2025-03-15T21:01:33Z")

</div>

Strange indeed.  
From memory, I don't believe I've needed to jsonEncode the dictionary first. If you write your `obj` directly to the document tag, do you still experience the rounding error?

---

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [March 15, 2025, 9:52pm UTC](https://forum.inductiveautomation.com/t/writing-to-document-tag-float-value-being-rounded/103740/3 "2025-03-15T21:52:09Z")

</div>

You are right, no need to convert object to jsonString. - was a result of my debuging.

But same result.

Its odd though, on tag Browser value column will show { ... 123.56} - but when I open tag, it will show like above screenshot. Hopeful its just a render issue.

I will try to do a Tag Read when I get home.

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [March 15, 2025, 10:00pm UTC](https://forum.inductiveautomation.com/t/writing-to-document-tag-float-value-being-rounded/103740/4 "2025-03-15T22:00:14Z")

</div>

> [@Eugene49](#):
>
> Hopeful its just a render issue.

I wondered the same thing. FWIW, I opened a document tag of mine (on 8.1.44) and observed the float value as-stored.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/1/813aa251e5f7c74f9e3ba8e433ea973f09ade85e.png)

---

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [March 16, 2025, 12:29am UTC](https://forum.inductiveautomation.com/t/writing-to-document-tag-float-value-being-rounded/103740/5 "2025-03-16T00:29:47Z")

</div>

Probably a old version issue..

When reading a document tag, I need to convert to dictionary, convert float literal to string then to float.. Otherwise, it throws error, value is not float.

Thank you.
