# Format Custom Alert Message

**URL:** <https://forum.inductiveautomation.com/t/format-custom-alert-message/2421>\
**Category:** Ignition\
**Created:** [December 13, 2010, 5:00pm UTC](https://forum.inductiveautomation.com/t/format-custom-alert-message/2421 "2010-12-13T17:00:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bhastie](https://avatars.discourse-cdn.com/v4/letter/b/d6d6ee/32.png) [@bhastie](https://forum.inductiveautomation.com/u/bhastie)\
**Post date:** [December 13, 2010, 5:00pm UTC](https://forum.inductiveautomation.com/t/format-custom-alert-message/2421/1 "2010-12-13T17:00:34Z")

</div>

I am alerting on pH and would like to format the pH value as 0.#. How can I format the {[VALUE]} in my custom alert message to 0.#? Right now I get things like pH High 7.78000020980835 when 7.8 would be sufficient.

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [December 14, 2010, 12:44am UTC](https://forum.inductiveautomation.com/t/format-custom-alert-message/2421/2 "2010-12-14T00:44:56Z")

</div>

Hi,

Unfortunately, right now the alert messages just do a straight substitution of the referenced value, and obviously it’s using the full string version of the float. I suppose that it should probably round the value, though better formatting control as part of the “language” might be useful.

I’ll put this in as a bug/feature request.

Regards,

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [January 19, 2011, 1:21am UTC](https://forum.inductiveautomation.com/t/format-custom-alert-message/2421/3 "2011-01-19T01:21:04Z")

</div>

This has been implemented for 7.2. You can now specify a format pattern (same as used in the [numberFormat](http://inductiveautomation.com/support/usermanuals/ignition/gen_strings_numberformat.htm) expression) for alert variables and tag references.

Here’s how it works:  
Previously there were 2 types of references in alert messages- tag references, formatted like [tt]{path/to/tag}[/tt] and alert property references, denoted similarly, but with square brackets as well: [tt]{[propname]}[/tt].  
Now you can add square brackets around tag paths as well. If you do that, you can add “|formatstring” in. For example:

```auto
{[path/to/tag|#0.00]}
```

and with properties, such as VALUE:

```auto
{[VALUE|#0.00]}
```

The extra square brackets around tag paths are used to tell the parser that there is likely going to be a format string. There doesn’t have to be, but it gives us the ability to use pipes in tag names in the future.

Regards,
