# Expression syntax to zero fill a string to 6 chars

**URL:** <https://forum.inductiveautomation.com/t/expression-syntax-to-zero-fill-a-string-to-6-chars/114450>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [March 11, 2026, 9:31pm UTC](https://forum.inductiveautomation.com/t/expression-syntax-to-zero-fill-a-string-to-6-chars/114450 "2026-03-11T21:31:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [March 11, 2026, 9:31pm UTC](https://forum.inductiveautomation.com/t/expression-syntax-to-zero-fill-a-string-to-6-chars/114450/1 "2026-03-11T21:31:46Z")

</div>

I have an expression tag that combines two tags, a string and integer tag. I need to make sure the Integer is always 6 numbers (fill with zeros if less than 999999, I.E… 000101), before I get crazy with this, is there a semi simple way to do this with the expression language or do I need to add some scripting to do it? Thanks!

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 11, 2026, 9:33pm UTC](https://forum.inductiveautomation.com/t/expression-syntax-to-zero-fill-a-string-to-6-chars/114450/2 "2026-03-11T21:33:59Z")

</div>

`numberFormat` with `"%06d"` for the pattern maybe?

---

<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:** [March 11, 2026, 9:36pm UTC](https://forum.inductiveautomation.com/t/expression-syntax-to-zero-fill-a-string-to-6-chars/114450/3 "2026-03-11T21:36:41Z")

</div>

> [@Kevin.Herron](#):
>
> `numberFormat` with `"%06d"`

`stringFormat`

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [March 11, 2026, 10:01pm UTC](https://forum.inductiveautomation.com/t/expression-syntax-to-zero-fill-a-string-to-6-chars/114450/4 "2026-03-11T22:01:15Z")

</div>

Thanks, I just used try(substring({[.]Prefix},1,3)+numberFormat(tag({Number}),"000000"), '')

I was definitely overthinking that one, thank you both!
