# How to convert int64 to fstring or tchar array

**URL:** <https://forums.unrealengine.com/t/how-to-convert-int64-to-fstring-or-tchar-array/381739>\
**Category:** Platform & Builds\
**Tags:** convert, fstring, unreal-engine, question\
**Created:** [January 13, 2017, 8:45am UTC](https://forums.unrealengine.com/t/how-to-convert-int64-to-fstring-or-tchar-array/381739 "2017-01-13T08:45:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![minions0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@minions0](https://forums.unrealengine.com/u/minions0)\
**Post date:** [January 13, 2017, 8:45am UTC](https://forums.unrealengine.com/t/how-to-convert-int64-to-fstring-or-tchar-array/381739/1 "2017-01-13T08:45:28Z")

</div>

how to convert int64 to fstring or tchar array except using fstring::printf ?

fstring::printf is platform dependent.  
and fstring::fromint is only support for int32.

---

<div class="post-metadata">

**Author:** ![jonimake](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jonimake](https://forums.unrealengine.com/u/jonimake)\
**Post date:** [March 10, 2017, 10:58pm UTC](https://forums.unrealengine.com/t/how-to-convert-int64-to-fstring-or-tchar-array/381739/2 "2017-03-10T22:58:22Z")

</div>

I’m wondering the same thing here. FString::Printf seems to wrap it.

---

<div class="post-metadata">

**Author:** ![Motanum](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Motanum](https://forums.unrealengine.com/u/Motanum)\
**Post date:** [April 13, 2017, 10:28pm UTC](https://forums.unrealengine.com/t/how-to-convert-int64-to-fstring-or-tchar-array/381739/3 "2017-04-13T22:28:27Z")

</div>

Any update on this question?

---

<div class="post-metadata">

**Author:** ![Motanum](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Motanum](https://forums.unrealengine.com/u/Motanum)\
**Post date:** [April 15, 2017, 2:02am UTC](https://forums.unrealengine.com/t/how-to-convert-int64-to-fstring-or-tchar-array/381739/4 "2017-04-15T02:02:36Z")

</div>

I finally figured it out after many crashes.

```
  FString returnString
 uint64 testInt = 2906622092;

//Conversion from uint64 to string!
char temp[21];
sprintf(temp, "%llu", testInt);
returnString = temp;

```

Hope this helps. An alternative to ‘%llu’ might be ‘PRIu64’, but I havent tested that. For some reason ‘%I64u’ didnt compile for me.

VS also will tag ‘%llu’, but it did compile.

---

<div class="post-metadata">

**Author:** ![Jambax](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jambax/32/904177_2.png) [@Jambax](https://forums.unrealengine.com/u/Jambax)\
**Post date:** [August 22, 2017, 6:40pm UTC](https://forums.unrealengine.com/t/how-to-convert-int64-to-fstring-or-tchar-array/381739/5 "2017-08-22T18:40:56Z")

</div>

Posting for future reference and others. You can actually use FString::Printf to do this for you:

```
FString::Printf(TEXT("%lld"), MyInt64);
FString::Printf(TEXT("%llu"), MyUInt64);

```

Just tested this and it works fine. Source:

> <https://stackoverflow.com/questions/38561/what-is-the-argument-for-printf-that-formats-a-long>
