Skip to content

Revert "[12.x] Update "Number::fileSize" to use correct prefix and add prefix param" #55741

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

Merged

Conversation

ziadoz
Copy link
Contributor

@ziadoz ziadoz commented May 15, 2025

Reverts #55678

The changes made here are breaking. The useBinaryPrefix parameter is false by default, which means the base is now 1000 instead of 1024. Defaulting it to true doesn't fix the issue though, as the units for 1024 will be KiB instead of KB.

This is breaking various frontend tests in my web app when Dependabot tries to update Laravel.

// Before
> Number::fileSize(1024)
= "1 KB"

// After
> Number::fileSize(1024, useBinaryPrefix: true)
= "1 KiB"

@taylorotwell taylorotwell merged commit fbb65d2 into laravel:12.x May 15, 2025
61 checks passed
@ziadoz ziadoz deleted the revert-55678-update-number-filesize branch May 15, 2025 21:38
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

Successfully merging this pull request may close these issues.

2 participants