-
-
Notifications
You must be signed in to change notification settings - Fork 723
Description
This issue is more of a minor nitpick, but I think it should either be fixed or documented.
Describe the issue
The memory module appears to be reading all its data from /proc/meminfo, which, despite the kB in its output, lists all values as kibibyte (1024 bytes). Polybar correctly converts this to mebi- and gibibytes by dividing by 1024 and displays the values as such. However, it indicates the units as "MB" and "GB", which is ambiguous. They should be "MiB" and "GiB" to be unambiguous (IEC 80000-13).
Expected behavior:
Polybar uses the correct unit indicators (binary units) for the memory values it displays.
Actual behavior:
Polybar uses ambiguous unit indicators (decimal units) for the memory values it displays.
Additional context
Lines 280 to 292 in f02fb67
| /** | |
| * Create a MB filesize string | |
| */ | |
| string filesize_mb(unsigned long long kbytes, size_t precision, const string& locale) { | |
| return floating_point(kbytes / 1024.0, precision, true, locale) + " MB"; | |
| } | |
| /** | |
| * Create a GB filesize string | |
| */ | |
| string filesize_gb(unsigned long long kbytes, size_t precision, const string& locale) { | |
| return floating_point(kbytes / 1024.0 / 1024.0, precision, true, locale) + " GB"; | |
| } |
The calculation is correct, but the unit indicators ("MB", "GB") are not. The comments and variable names also all reference decimal units (kbytes, mb, gb, ...) despite referring to binary units.