Appending engineering units to Bound Label

I’m trying to append, or at the very least use, engineering units for labels that I have bound to certain tags. I have tried to use the “Format” transform, but it seems to only want to use capital letters (which for things like pH make its look off, and incorrect). Is there any way to do this? I figured there might be a way with an expression, but I’m not entirely sure.

Thanks!

Great question, here are two samples I’ve used previously using an expression:

  1. tag({view.params.TagPath}+“/ScaledValue”)+" " + tag({view.params.TagPath}+“/ScaledValue.EngUnit”)

  2. numberFormat(tag({MAI.Path}+“/PV”), tag({MAI.Path}+“/PV.FormatString”))+ " " + tag({MAI.Path}+“/Units”)

NOTES:

  1. Item 1 - This sample uses the engineering units from the built in field in the tag (“ScaledValue.EngUnit”).

  2. Item 2 - This formats the number based on the built in field in the tag (“PV.FormatString”). Also, it uses engineering units from an external tag (“Units” rather than “PV.EngUnit”).

Hope this helps out!

Consider using an expression transform with stringFormat() instead of number formatting. There are more options, including passing a string argument through unchanged.