# Script to format tag as string using engUnit & formatstring properties

**URL:** <https://forum.inductiveautomation.com/t/script-to-format-tag-as-string-using-engunit-formatstring-properties/25753>\
**Category:** Ignition\
**Tags:** perspective, scripting, ignition80\
**Created:** [June 12, 2019, 2:01am UTC](https://forum.inductiveautomation.com/t/script-to-format-tag-as-string-using-engunit-formatstring-properties/25753 "2019-06-12T02:01:10Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [June 12, 2019, 4:01am UTC](https://forum.inductiveautomation.com/t/script-to-format-tag-as-string-using-engunit-formatstring-properties/25753/3 "2019-06-12T04:01:59Z")

</div>

Going down the route of binding to each value gets very complicated quickly in my case. At a very high level I’m trying to fill in the data for a table component on the fly based on a mix of generated data and tag values. If the total number of rows was fixed I could plausibly bind at the cell level instead of the whole data table, but I’d have to create a buttload of bindings…

I’m more intrigued by the [this post](http://forum.inductiveautomation.com/t/sdk-apply-formatstring-to-a-value/15976/2) that implies the FormatString is handled by the java.text DecimalFormat class, and the fact that I can do this in the scripting console:

```auto
>>> from java.text import DecimalFormat
>>> formatter = DecimalFormat("#,##0.0")
>>> formatter.format(2.1023)
u'2.1'

```

The actual work of piecing it all together just got much easier…

---

_[View the full topic](https://forum.inductiveautomation.com/t/script-to-format-tag-as-string-using-engunit-formatstring-properties/25753)._
