Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed default number format #1114

Merged
merged 4 commits into from
Oct 29, 2021
Merged

Fixed default number format #1114

merged 4 commits into from
Oct 29, 2021

Conversation

YohDeadfall
Copy link
Contributor

This PR fixes an issue happening only when ToString() is invoked on a ByteSize. Since parameterless ToString is optimized and doesn't invoke ToString(string format) it uses {0} {1} to create an output string, but this format has no information on how a value should be displayed and prints a number with high precision.

@YohDeadfall
Copy link
Contributor Author

Hello, @clairernovotny! Could you take a look at this PR and clarify its status?

@clairernovotny clairernovotny merged commit aea2bf9 into Humanizr:main Oct 29, 2021
@YohDeadfall YohDeadfall deleted the fix-default-number-format branch October 29, 2021 12:50
@clairernovotny
Copy link
Member

@YohDeadfall
Copy link
Contributor Author

Will take a look.

@@ -47,7 +47,7 @@ public void TimeUnitTests(long megabytes, double measurementIntervalSeconds, Tim
}

[Theory]
[InlineData(19854651984, 1, TimeUnit.Second, null, "18.4910856038332 GB/s")]
[InlineData(19854651984, 1, TimeUnit.Second, null, "18.49 GB/s")]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird. This line isn't present in main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants