Convert float to FString? (C++)

Dear Pinheiro,

To convert float to Fstring you do this:

FString TheFloatStr = FString::SanitizeFloat(f);

To get the TCHAR version of this FString quickly you can do this

*TheFloatStr

so the final result is:

FString TheFloatStr = FString::SanitizeFloat(f);
GEngine->AddOnScreenDebugMessage( -1,1.0,FColor::Red, *TheFloatStr );

to convert FString to float I have tutorial on this here:
http://forums.epicgames.com/threads/973803-Tutorials-Entry-Level-UE4-C-Overview-Q-amp-A-New-Working-with-Config-Files-C?p=31686875&viewfull=1#post31686875

If this answers your question please mark the checkmark by my answer so others know it is resolved

:slight_smile:

Rama

19 Likes