# Integer vs String

**URL:** <https://forum.inductiveautomation.com/t/integer-vs-string/729>\
**Category:** Archived Topics\
**Created:** [July 15, 2008, 3:35pm UTC](https://forum.inductiveautomation.com/t/integer-vs-string/729 "2008-07-15T15:35:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrtweaver](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mrtweaver](https://forum.inductiveautomation.com/u/mrtweaver)\
**Post date:** [July 15, 2008, 3:35pm UTC](https://forum.inductiveautomation.com/t/integer-vs-string/729/1 "2008-07-15T15:35:06Z")

</div>

In a dynamic property I have a value which is an Integer value. What I would like to be able to do is take another dynamic proper which is a String value and have it equal the Integer value but be 2 digits in length.

So if the Integer Value is = 1 then the string Value would be 01, if the Integer Value is 23 then the string value would be 23.

I though that this was what the ‘NUMBERFORMAT’ command was for but it does not make the string 2 digits.

This is the code that I tried:

numberFormat({Root Container.value1},’##’) - [this code is equal to value2 which is a dynamic property which is set to string.]

value1 is a dynamic property which is set to Integer.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [July 15, 2008, 4:16pm UTC](https://forum.inductiveautomation.com/t/integer-vs-string/729/2 "2008-07-15T16:16:22Z")

</div>

You should check out the user manual page for the numberFormat expression here: [inductiveautomation.com/prod … mberformat](http://www.inductiveautomation.com/products/factorypmi/usermanual/source/technical/expression/stringfunctions.htm#numberformat)

From that page:

[quote]Pattern Characters  
0 - A required digit  
# - Optional digit - 0 is not shown.[/quote]

try:

```auto
numberFormat({Root Container.value1},'00')
```
