# Char() returning random character

**URL:** <https://forum.inductiveautomation.com/t/char-returning-random-character/92213>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [June 21, 2024, 2:23pm UTC](https://forum.inductiveautomation.com/t/char-returning-random-character/92213 "2024-06-21T14:23:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [June 21, 2024, 2:23pm UTC](https://forum.inductiveautomation.com/t/char-returning-random-character/92213/1 "2024-06-21T14:23:51Z")

</div>

I had the need to convert integer to string in the UDT. I used the char() and it is returning random character within each udt instance.  
 ![2024-06-21 10_17_08-Tag Editor](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/c/9c269b9d586a87899165ef2c55d67a9ea0d3229e.png)  
 ![Ig](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/1/e14dd76c76d3f30ff1f12b273f382a22ecd13c0c.png)

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [June 21, 2024, 2:26pm UTC](https://forum.inductiveautomation.com/t/char-returning-random-character/92213/2 "2024-06-21T14:26:08Z")

</div>

`char` returns the ASCII character, you're probably intending to use `str`

---

<div class="post-metadata">

**Author:** ![Anant\_Upadhyayula](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Anant\_Upadhyayula](https://forum.inductiveautomation.com/u/Anant_Upadhyayula)\
**Post date:** [June 21, 2024, 2:37pm UTC](https://forum.inductiveautomation.com/t/char-returning-random-character/92213/3 "2024-06-21T14:37:46Z")

</div>

Thank you tried Tostr and it worked
