Changing the unit display from MiB/GiB to MB/GB in Dolphin

Hello,

Dolphin displays HDD capacities and file sizes in MiB/GiB units (1 MiB=1024 KiB etc).
I would like to have the display in MB/GB SI units (1MB=1000 KB=1,000,000 B etc). I have not found a setting that would accomplish this. I would like to have this because I need to move some files between storage hdds and I need to calculate space as accurately as possible (and as easily as possible).
I have found mention that in kde 3 there was an option for this, and that in kde 4 this could be achieved like so:

Add the BinaryUnitDialect=0 option to the [Locale] group of your $KDEHOME/share/config/kdeglobals file.

setting to 0 (or leaving unset, of course) gives you the current default of IEC units since they are unambiguous and in accordance with the current revision of the relevant standards documents. Setting to 1 gives you JEDEC units. Setting to 2 gives you metric (yes, real powers-of-10, lowercase k instead of K, metric units).

I have tried this in the current Kde (I am on an up to date Kde Neon) but it does not appear to work.
The ~/.kde/share/config/kdeglobals file on my system did not contain a [Locale] section, so I created it along with the option mentioned above.

Is there a way to accomplish this?

Thanks

Try ~/.config/kdeglobals

I tried, but it did nothing.

1 Like

there were 5 or 6 copies of this file in various places and in various states of “completeness”

adding the prescribed section and parameter did noting no matter which file it was added to

Make sure you are setting BinaryUnitDialect=2 for SI units (in the file $HOME/.config/kdeglobals as Angus noted). However it seems like Dolphin’s main panel does not respect this config choice. The properties dialogue and disk usage (shown at the bottom strip) will use the correct unit though. Also worth noting that FileLight does not respect the users’ binary dialect choice either.

There is a bug report for dolphin here and I’ve just opened one for FileLight here

confirmed: this only affects the status line at the bottom of the dolphin GUI

it does not affect the size column values, nor does it affect the devices info on the side bar.

After some investigating I’ve found the source of the issue. It seems that there is a standard formatBinarySize function which takes care of the formatting for apps. In the KDE 4 times this function would grab the default format value from a config file [1]. The KDE 5 function doesn’t do this but instead uses the IEC value as a fallback [2]. However, the code that deals with Dolphin’s property window comes from the KIO which re-implements the config check [3]. Hence we’ve ended up in the situation where this config option is ignored by all of KDE except KIO :cry:.

[1] src/kdecore/klocale_kde.cpp · kf5 · Frameworks / KDE4 Support · GitLab
[2] src/lib/util/kformatprivate.cpp · master · Frameworks / KCoreAddons · GitLab
[3] src/core/global.cpp · master · Frameworks / KIO · GitLab