# Format string of OPC tag goes away when OPC tag is bind to a custom property

**URL:** <https://forum.inductiveautomation.com/t/format-string-of-opc-tag-goes-away-when-opc-tag-is-bind-to-a-custom-property/82113>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [November 20, 2023, 9:33am UTC](https://forum.inductiveautomation.com/t/format-string-of-opc-tag-goes-away-when-opc-tag-is-bind-to-a-custom-property/82113 "2023-11-20T09:33:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [November 20, 2023, 9:33am UTC](https://forum.inductiveautomation.com/t/format-string-of-opc-tag-goes-away-when-opc-tag-is-bind-to-a-custom-property/82113/1 "2023-11-20T09:33:26Z")

</div>

Hi,  
I'm facing a problem with the format of a OPC tag. The tag has a float value with the following format: ##0,## and shows as follows: 14.42, but when I bind it to a custom property the whole format goes away. Anyone that knows a solution to this?  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/6/b61ecdbc33355b51a1cf757b251be3d482bbda4f.png)

It should be this:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/6/a608ad1be91006fb0a722addaf5078c0e2bffecc.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [November 20, 2023, 10:17am UTC](https://forum.inductiveautomation.com/t/format-string-of-opc-tag-goes-away-when-opc-tag-is-bind-to-a-custom-property/82113/2 "2023-11-20T10:17:14Z")

</div>

Create an expression binding.

```auto
numberFormat(
    {[default]tolMin}, 
    {[default]tolMin.FormatString}
)

```

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [November 20, 2023, 11:04am UTC](https://forum.inductiveautomation.com/t/format-string-of-opc-tag-goes-away-when-opc-tag-is-bind-to-a-custom-property/82113/3 "2023-11-20T11:04:01Z")

</div>

> [@Transistor](#):
>
> ```auto
> numberFormat(
> {[default]tolMin}, 
> {[default]tolMin.FormatString}
> )
> 
> ```

Now it rounds the number off but still has all the decimals behind it.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/b/8bcdf5103c92acf25937d5f97a8558039c6340ca.png)  
This is the format I'm using  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/8/68ac42ab8d28006551af99a7ffed3001fa950e25.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [November 20, 2023, 11:13am UTC](https://forum.inductiveautomation.com/t/format-string-of-opc-tag-goes-away-when-opc-tag-is-bind-to-a-custom-property/82113/4 "2023-11-20T11:13:57Z")

</div>

> [@Stef\_Velers](#):
>
> Now it rounds the number off but still has all the decimals behind it.  
> ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/b/8bcdf5103c92acf25937d5f97a8558039c6340ca.png)  
> This is the format I'm using  
> ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/8/68ac42ab8d28006551af99a7ffed3001fa950e25.png)

I notice that your format string uses a decimal point (dot) but your display is using European comma decimal seperator. Is this a locale issue, I wonder?

---

<div class="post-metadata">

**Author:** ![Stef\_Velers](https://avatars.discourse-cdn.com/v4/letter/s/bc8723/32.png) [@Stef\_Velers](https://forum.inductiveautomation.com/u/Stef_Velers)\
**Post date:** [November 22, 2023, 9:55am UTC](https://forum.inductiveautomation.com/t/format-string-of-opc-tag-goes-away-when-opc-tag-is-bind-to-a-custom-property/82113/5 "2023-11-22T09:55:43Z")

</div>

Sorry for the late reaction. But for some reason if you give the value of a tag a format and then give a custom property that tag, the tag format is gone. but when I make another custom property and make the following expression:  
`numberFormat( {[Test SCADA Ignition]Action/Action10/hmi/tolMin}, {[Test SCADA Ignition]Action/Action10/hmi/tolMin.FormatString} )`  
and then bind this custom property to the first custom property I made the format does work.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [November 22, 2023, 10:09am UTC](https://forum.inductiveautomation.com/t/format-string-of-opc-tag-goes-away-when-opc-tag-is-bind-to-a-custom-property/82113/6 "2023-11-22T10:09:27Z")

</div>

Yes, the format should only be used for _display_. The true value would always be passed otherwise which is usually what is required.
