Skip to content

Don't show fractional bytes in file size display#3210

Merged
david-crespo merged 5 commits intomainfrom
claude/fix-console-3209-8kliY
May 6, 2026
Merged

Don't show fractional bytes in file size display#3210
david-crespo merged 5 commits intomainfrom
claude/fix-console-3209-8kliY

Conversation

@david-crespo
Copy link
Copy Markdown
Collaborator

filesize's pad: true option pads results like "5 B" to "5.00 B", but
fractional bytes are nonsensical. Add a formatBytes wrapper that
suppresses padding when the unit is bytes, and use it in FileInput and
the image upload progress display.

Closes #3209

filesize's `pad: true` option pads results like "5 B" to "5.00 B", but
fractional bytes are nonsensical. Add a `formatBytes` wrapper that
suppresses padding when the unit is bytes, and use it in FileInput and
the image upload progress display.

Closes #3209
@vercel
Copy link
Copy Markdown

vercel Bot commented May 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
console Ready Ready Preview May 5, 2026 9:50pm

Request Review

@david-crespo
Copy link
Copy Markdown
Collaborator Author

Initial Claude solution was sufficient to fix the problem, but caused some fragmentation by introducing a new helper that we only use in some spots. I updated the helper so it could be used everywhere we currently call filesize directly.

Copy link
Copy Markdown
Contributor

@charliepark charliepark left a comment

Choose a reason for hiding this comment

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

👍

@david-crespo david-crespo merged commit 099d463 into main May 6, 2026
7 checks passed
@david-crespo david-crespo deleted the claude/fix-console-3209-8kliY branch May 6, 2026 15:09
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.

fractional bytes don't make sense

3 participants