# Imperial/Metric conversion: Where do you put your single source of truth?

**URL:** <https://forum.inductiveautomation.com/t/imperial-metric-conversion-where-do-you-put-your-single-source-of-truth/113313>\
**Category:** Ignition\
**Created:** [January 15, 2026, 12:49pm UTC](https://forum.inductiveautomation.com/t/imperial-metric-conversion-where-do-you-put-your-single-source-of-truth/113313 "2026-01-15T12:49:17Z")\
**Posts on this page:** 9\
**Page:** 2

<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:** [January 16, 2026, 7:32pm UTC](https://forum.inductiveautomation.com/t/imperial-metric-conversion-where-do-you-put-your-single-source-of-truth/113313/22 "2026-01-16T19:32:52Z")

</div>

> [@Brian\_Stilson](#):
>
> Or am I not implementing it correctly?

Your load function is **replacing** the `CONVERSIONS` top level object by assigning to it. Don't replace it. Assign **into** it. (Perhaps use the `.update()` method.)

Be aware that your variable is per leaf project, not global. All leaf projects that will use this need to call `load()` in their gateway startup script.

(Note, you should use `system.util.jsonDecode()` instead of jython's `json` module.)

---

<div class="post-metadata">

**Author:** ![Brian\_Stilson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian_stilson/32/73410_2.png) [@Brian\_Stilson](https://forum.inductiveautomation.com/u/Brian_Stilson)\
**Post date:** [January 16, 2026, 8:01pm UTC](https://forum.inductiveautomation.com/t/imperial-metric-conversion-where-do-you-put-your-single-source-of-truth/113313/23 "2026-01-16T20:01:13Z")

</div>

OK. I’ve replaced

CONVERSIONS = data

with

CONVERSIONS.update(data)

EDIT: For whatever reason, I can’t get CONVERSIONS to reliably retain any data.

EDIT #2: I _might_ have this right. I had that script running as a Gateway startup script. I moved it to be a session startup script. I hope that’s not going to bite me later, but I don’t see why it would. That seems to have loaded the values ok. I’ll keep testing.

EDIT #3: I prematurely celebrated. After taking out all my debug stuff it stopped working.. Sigh

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [January 16, 2026, 11:46pm UTC](https://forum.inductiveautomation.com/t/imperial-metric-conversion-where-do-you-put-your-single-source-of-truth/113313/24 "2026-01-16T23:46:33Z")

</div>

I feel like the larger problem will be the historian trying to pull in data in the proper units. Personally if there's only ever going to be 2 units between imperial and metric (and no 3rd option), I'd almost modify your UDTs to have the I/O tags being imperial in your case and a second tag with the metric converted value using an expression tag and historize both. For example FT\_1234.FlowImperial and FT\_1234.FlowMetric or something similar. Then your tagging would all be indirect with a session property string that has "Imperial" or "Metric" that gets to be part of your indirect tagging. When it comes to historizing if they're using the tag picker, the user can pick which set of units they want to use. Yes, this takes some extra storage on the historian, but storage is cheap anymore.

---

<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:** [January 16, 2026, 11:52pm UTC](https://forum.inductiveautomation.com/t/imperial-metric-conversion-where-do-you-put-your-single-source-of-truth/113313/25 "2026-01-16T23:52:08Z")

</div>

> [@michael.flagler](#):
>
> converted value using an expression tag and historize both

_Cough_. I talked him out of that already.

Doubling one's DB load just for this is ridiculous, IMNSHO.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [January 16, 2026, 11:53pm UTC](https://forum.inductiveautomation.com/t/imperial-metric-conversion-where-do-you-put-your-single-source-of-truth/113313/26 "2026-01-16T23:53:06Z")

</div>

How would you propose handling tag history then if they want to be able to historize in either/or/both units?

---

<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:** [January 16, 2026, 11:54pm UTC](https://forum.inductiveautomation.com/t/imperial-metric-conversion-where-do-you-put-your-single-source-of-truth/113313/27 "2026-01-16T23:54:59Z")

</div>

You don't. You historize each point in the units the device supplies. Do unit conversions at point of display. Yeah, the PowerChart cannot do this, but serious people don't use it anyways.

---

<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:** [January 17, 2026, 7:59pm UTC](https://forum.inductiveautomation.com/t/imperial-metric-conversion-where-do-you-put-your-single-source-of-truth/113313/28 "2026-01-17T19:59:30Z")

</div>

Linking a previous post:

> [@Numeric entry with unit conversion (bidirectional) question](https://forum.inductiveautomation.com/t/numeric-entry-with-unit-conversion-bidirectional-question/113027/9):
>
> Regarding "bind a custom property to engUnit on the tag" above, the goal would be to allow conversion from any unit to another of the operator's choosing. The conversion would be a two-step process, but straightforward. Ex: "R" --\> "degF" --\> "degC" (where 'degF' is selected as your 'standard' for temperature conversion). Consider building a table (as a tag and/or session prop?) which contains everything needed for any unit conversion to another. Something resembling: Units Type Factor Offs…

The expression transform will be more performant. The dataset should be very maintainable, straightforward to update and maintain….no scripting required.

---

<div class="post-metadata">

**Author:** ![Brian\_Stilson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/brian_stilson/32/73410_2.png) [@Brian\_Stilson](https://forum.inductiveautomation.com/u/Brian_Stilson)\
**Post date:** [January 19, 2026, 12:58pm UTC](https://forum.inductiveautomation.com/t/imperial-metric-conversion-where-do-you-put-your-single-source-of-truth/113313/29 "2026-01-19T12:58:09Z")

</div>

Unless you’re using Ignition Edge. I have yet to find a good charting option that will work with it. As you know, Edge is not compatible with most 3rd party modules. That’s become a pain point in all of this for me. One of the features of the Power Chart is the ability to programmatically “push” an X-trace, which cannot be done on the time series chart. I have it set up where there’s an event log table in a docked view the user can pop out, click on an event, and the chart will automatically zoom to that point in time, displaying an x-trace at the time stamp. Clicking the chart triggers a message with that record’s timestamp as the payload, and the chart responds to it by adjusting itself to what it needs to show. The customer loves this and is not willing to give it up. At this point they’re even willing to just lock the chart to being in native units only for now until a better solution comes along.

I’m not using the Power Chart because I’m not serious. It’s literally the only thing I’m aware of that can give my customer what they want with the tools I’ve been given.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [January 19, 2026, 1:12pm UTC](https://forum.inductiveautomation.com/t/imperial-metric-conversion-where-do-you-put-your-single-source-of-truth/113313/30 "2026-01-19T13:12:39Z")

</div>

One of the key things I try to do with all of our standards is to make sure anything I build is compatible with both Standard and Edge editions because we do so much of both. Granted there will always be things that aren't (like diagnostics for databases), but in general I try to make as much as possible work for either version without modification.

[Previous page](https://forum.inductiveautomation.com/t/imperial-metric-conversion-where-do-you-put-your-single-source-of-truth/113313.md?page=1)
