Sometimes people accuse me of misnumbering things when I type “4Mhz” or “64Kb,” because there is a difference in numbering and how the abbreviations are used. Which is true.
In my defense, I’ll say that I adopted the uppercase-lowercase style as a concession to the AP Stylebook, which (last time I checked) doesn’t rule on things like mebibytes. I have other reasons, which are rather boring (skip to the end if you want to know).
Regardless, “Mb” seems to cover the idea for me, and I can’t recall ever running into problems, except perhaps when talking about labeling actual, exact, bit-for-bit drive storage space. Which is a scam, anyway.👿
But the next time you want to scold your friendly neighborhood Linux blogger, you can critique the writer’s integrity with
numfmt. Another of the coreutils gems, you can get almost any proper formatting for a number in as simple a command as this:
kmandla@6m47421: ~$ numfmt --to=iec-i 64738 64Ki
kmandla@6m47421: ~$ numfmt --to=iec 64738 64K
kmandla@6m47421: ~$ numfmt --to=si 64738 65K
And so forth, and so on.
numfmt will also convert back from abbreviated formats, in such as this:
kmandla@6m47421: ~$ numfmt --from=si 65K 65000 kmandla@6m47421: ~$ numfmt --from=iec 65K 66560 kmandla@6m47421: ~$ numfmt --from=iec-i 65Ki 66560
A little boring, but useful when I need to convert 59.75Gi back into a full string of numbers. …
kmandla@6m47421: ~$ numfmt --from=iec-i 59.75Gi 64156073984
Remember this, the next time you need to partition a drive with fdisk. It might just save you a trip to Google.😉
P.S.: For those who really need to know … my rationale on deviating from pure AP Style on MB and MHz and so forth, is that the words are spelled out in full as “megabyte” and “megahertz.” We don’t write “megaByte” or “megaHertz,” or for that matter, split the words as “mega byte” or “mega Hertz.” Since the abbreviations “MB” and “MHz” are deviations from other abbreviations like “km” for kilometer and “kHz” for kilohertz, my mind says “Mb” and “Mhz” aren’t polluting any rules on uppercase and lowercase as they should appear in print. It seems these are determined on a case-by-case basis of what looks right. Of course, you could say that about a lot of things in the AP Stylebook. …