Skip to content

Wrong symbols used for byte conversion #4704

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

Open
sreichel opened this issue Mar 14, 2025 · 0 comments
Open

Wrong symbols used for byte conversion #4704

sreichel opened this issue Mar 14, 2025 · 0 comments

Comments

@sreichel
Copy link
Contributor

sreichel commented Mar 14, 2025

$symbol = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
$exp = floor(log($bytes) / log(1024));

Technically, these are the wrong symbols, (KB=1000, KiB=1024) but that might be for another time

Originally posted by @Hanmac in #4693 (comment)

@sreichel sreichel changed the title Wrong symbols used for bytes Wrong symbols used for byte conversion Mar 14, 2025
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

1 participant