Skip to content

Show user-friendly memory size unit and accurate total physical available memory size - #554

Open
vjr wants to merge 7 commits into
mainfrom
vishal/memory-unit
Open

vjr wants to merge 7 commits into
mainfrom
vishal/memory-unit

Conversation

@vjr

@vjr vjr commented Sep 15, 2026

Copy link
Copy Markdown
Member

Observe the screenshots where before it would show eg. total memory as "125.4 GiB" and other memory size units in IEC format eg. "MiB" with the lowercase letter I.

This PR proposes a more user-friendly format to always show the units eg. "MB" or "GB" and if the size is an exact factor/power of 2 then exclude the decimal place eg. "128 GB" instead of "128.0 GB" otherwise show eg. "3.1 MB".

This is similar to elementary/settings-system#251 and elementary/settings-system#252 which can be considered prior art.

BEFORE:
memory-size-before

AFTER:
memory-size-after

vjr added 2 commits September 15, 2026 20:18
Set the IEC_UNITS flag separately for the value but refrain using it for the unit string.
Memory sizes unit strings are always shown without the lowercase letter I eg. "MB" or "GB" instead of "MiB" or "GiB".
Rationale for this commit is to not have your average user wonder what that lowercase letter I depicts.
Also update util memory size format function to:
 - show the full format with single decimal place eg. "3.1 MB" unless,
 - the size is an exact factor/power of 2 then show eg. "32 GB".

This is to show accurate total physical memory available eg. "32 GB" instead of previously showing "31.2 GiB" which libgtop would report.
@vjr vjr self-assigned this Sep 15, 2026
@vjr
vjr requested review from a team, danirabbit, ryonakano and stsdc September 15, 2026 16:10
Comment thread README.md Outdated
@vjr
vjr requested a review from ryonakano September 16, 2026 18:27
@ryonakano

Copy link
Copy Markdown
Member

Could you resolve the conflicts?

@vjr

vjr commented Sep 17, 2026

Copy link
Copy Markdown
Member Author

Could you resolve the conflicts?

@ryonakano done!

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