x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

FMath::FormatIntToHumanReadable are forgotting (1) the 3rd comma pattern for a positive value and (2) a negative value support

repro:

Run the code:

 UE_LOG( LogTemp, Log, TEXT( "int32 max={%s}" ), *FMath::FormatIntToHumanReadable( std::numeric_limits<int32>::max() ) );
 UE_LOG( LogTemp, Log, TEXT( "int32 min={%s}" ), *FMath::FormatIntToHumanReadable( std::numeric_limits<int32>::min() ) );

Expected result:

 [2017.11.22-06.35.46:964][  1]LogTemp: int32 max={2,147,483,647}
 [2017.11.22-06.35.46:965][  1]LogTemp: int32 min={-2,147,483,648}

Actual result:

 [2017.11.22-06.35.46:964][  1]LogTemp: int32 max={2147,483,647}
 [2017.11.22-06.35.46:965][  1]LogTemp: int32 min={-2147483648}

Current documentation:

 /**
  * Formats an integer value into a human readable string (i.e. 12345 becomes "12,345")
  *
  * @param    Val        The value to use
  * @return    FString    The human readable string
  */

Proposal to fix: (Either)

a. Support the 3rd comma pattern and a negative value pattern.

b. Rewrite the document to fit a current implementation limitation.

References:

  1. Header: https://github.com/EpicGames/UnrealEngine/blob/4.18/Engine/Source/Runtime/Core/Public/Math/UnrealMathUtility.h#L1322

  2. Source: https://github.com/EpicGames/UnrealEngine/blob/4.18/Engine/Source/Runtime/Core/Private/Math/UnrealMath.cpp#L2768

Product Version: UE 4.18
Tags:
more ▼

asked Nov 22 '17 at 07:05 AM in Bug Reports

avatar image

usagi-wrp
15 4 8 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first
more ▼

answered Dec 05 '17 at 08:17 AM

avatar image

usagi-wrp
15 4 8 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question