Advertisement
Guest User

Untitled

a guest
May 3rd, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.62 KB | None | 0 0
  1. FString IStringUtils::UnsignedIntToString(const uint32& NumericValue, FString DefaultValue)
  2. {
  3.     FString Result;
  4.  
  5.     TCHAR* Buffer = TEXT("");
  6.    
  7.     uint32 NumberToBeDismantled = NumericValue;
  8.     int32 BufferIndex = 0;
  9.    
  10.     do
  11.     {
  12.         FString String = FString::FromInt(NumberToBeDismantled % 10); //Debug variable
  13.         *Buffer = *(const_cast<TCHAR*>(*String));
  14.  
  15.         NumberToBeDismantled /= 10;
  16.        
  17.         if(NumberToBeDismantled > 0)
  18.         {
  19.             Buffer++;
  20.             BufferIndex++;
  21.         }      
  22.     } while(NumberToBeDismantled != 0);
  23.        
  24.  
  25.     for (int Index = 0; Index <= BufferIndex; Index++)
  26.     {
  27.         Result += *(Buffer - Index);
  28.     }
  29.  
  30.     return Result;
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement