Skip to content

Refactor: standardize memory byte formatting across the codebase#37

Merged
SickleFire merged 1 commit into
SickleFire:masterfrom
paarothecoder:fix-memory-formatting
Jun 9, 2026
Merged

Refactor: standardize memory byte formatting across the codebase#37
SickleFire merged 1 commit into
SickleFire:masterfrom
paarothecoder:fix-memory-formatting

Conversation

@paarothecoder

Copy link
Copy Markdown
Contributor

fixes #34

I created a centralized utility module at {src/utils/formatting.rs}. It includes a {format_bytes(size: u64) -> String} function that automatically scales the size to the appropriate base-2 unit (B, KB, MB, GB, TB) and formats it consistently to two decimal places.

@SickleFire SickleFire self-requested a review June 9, 2026 02:01

@SickleFire SickleFire left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The code looks great. The logic is clean, and using f64 constants for the byte conversions is a good approach.

@SickleFire SickleFire merged commit 7947fb1 into SickleFire:master Jun 9, 2026
2 checks passed
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.

Memory byte size formatter

2 participants