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

ValueFormat uses most copied stack exchange code in the world, which also has a bug #2132

Closed
badvision opened this issue Dec 5, 2019 · 1 comment

Comments

@badvision
Copy link
Contributor

badvision commented Dec 5, 2019

Bug details

The human-readable byte size converter function in ValueFormat uses the most popular stack exchange code snippet in the world, but close to (but not exceeding) boundary thresholds it tends to perform incorrectly due to precision errors in the math involved.

The fix

The original author (Andreas Lundblad) has posted explanations of the issue and the fix here: https://programming.guide/worlds-most-copied-so-snippet.html

@joerghoh
Copy link
Contributor

joerghoh commented Jan 5, 2020

For a potential fix see #2148

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

No branches or pull requests

2 participants