Fixed scientific convention issue in image size#4459
Closed
Affan-7 wants to merge 2 commits intodocker:masterfrom
Closed
Fixed scientific convention issue in image size#4459Affan-7 wants to merge 2 commits intodocker:masterfrom
Affan-7 wants to merge 2 commits intodocker:masterfrom
Conversation
Signed-off-by: Mohammed Affan <72978371+Affan-7@users.noreply.github.com>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #4459 +/- ##
=======================================
Coverage 59.39% 59.39%
=======================================
Files 288 288
Lines 24782 24782
=======================================
Hits 14720 14720
Misses 9175 9175
Partials 887 887 |
Member
|
Looks like this passes the existing tests, which is good. Can you please add a regression test (using your sample values from the PR body) to demonstrate the correctness of the fix/ensure we don't reintroduce it later? |
Signed-off-by: Mohammed Affan <72978371+Affan-7@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #3091
In this code
HumanSizeWithPrecision()method is used.This method takes two parameters
sizeandprecision.- Here is what I did:
I tried to reproduce the bug with this code.
And this resulted in
1e+03MBbeing output.So I changed precision from
3to4like the following.And this gave me
999.9MBoutput.In conclusion, this unexpected scientific convention results when we use precision
3.In go-unit library the
HumanSize()method usesHumanSizeWithPrecision(size, 4)method under the hood, So I usedHumanSize()instead of usingHumanSizeWithPrecision().- Description for the changelog
Replaced HumanSizeWithPrecision() with HumanSize().
- A picture of a cute animal (not mandatory but encouraged)
