doug-101 / ConvertAll-py

a flexible unit converter
http://convertall.bellz.org
39 stars 15 forks source link

MiB MB conversion #3

Closed TuxVinyards closed 4 years ago

TuxVinyards commented 5 years ago

Ref: https://github.com/doug-101/ConvertAll/blob/9312b327a4ccee9b4ab7c4eb08554d7796164a73/data/units.dat

https://en.wikipedia.org/wiki/Kilobyte: "The binary interpretation of metric prefixes is still prominently used by the Microsoft Windows operating system,[9] but is deprecated or obsolete in other operating systems. "

And: "In December 1998, the IEC addressed such multiple usages and definitions by creating prefixes such as kibi, mebi, gibi, etc., to unambiguously denote powers of 1024. Thus the kibibyte, symbol KiB, represents 2^10 = 1024 bytes. These prefixes are now part of the International System of Quantities. The IEC further specified that the kilobyte should only be used to refer to 1000 bytes."

See chart: https://en.wikipedia.org/wiki/Mebibyte

doug-101 commented 5 years ago

In my opinion, ConvertAll already handles this correctly. There are units that use the powers of 10 ("kilobyte IEC std", etc.) and those that use powers of 2 ("kibibyte", "kilobyte", etc.). Both systems are in common use depending on platform and what is being referenced. I decided to have the plain "kilobyte" default to a power of 2 because the power of 10 conversion is so trivial that few would need a conversion program to calculate it.

TuxVinyards commented 5 years ago

Thanks for reply Doug. I can see where my confusion has arisen now: the default of the plain unit.

Your program share is much appreciated. I have found it quite a useful little goto accessory for a number of years now. But I guess that is where the problem lies. It has been quite a few years. My personal experience is that MiB are taking the edge now, which is the reason I raised this issue.

Yesterday, due to the number of programs now reporting output in MiB, I wanted to check the results against my file manager. ConvertAll told me that 36.5 MiB = 36.5 MB.

If I do the conversion with DuckGo, the answer is 38.27302:

https://duckduckgo.com/?q=convert+36.5+MiB+to+MB&t=canonical&ia=answer

I wonder if now is the time to change the defaults the other way round. Plain MB should be base 10 (legacy). Or alternatively, how difficult would an option switch be?

doug-101 commented 5 years ago

I would be happy if sane operating systems (Linux, etc.) took over, but, unfortunately, MS is still common (with inconsistent units). I don't think MiB is commonly used enough to switch it yet.