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.
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.
I’m wondering the same thing here. FString::Printf seems to wrap it.
Any update on this question?
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.
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: