Option to select binary or decimal units for file sizes
-
Vivaldi 6.2 changed the default file size conversion to be based on "decimal SI units":
[Downloads][Panels] Use decimal SI units instead of legacy binary units (VB-98728)
[Mail] Render the Size column in human-readable decimal SI units instead of raw bytes VB-98728
While it may have pleased some, others (like me) would like to stay with the binary units, for many reasons.
I think it would be important for the user to be able to use the format of his choice. It would be fair the implementation to use the corresponding prefixes (eg. MiB/MB).
-
If someone ask me, I say: decimal sizes makes no sense and is used only for marketing purposes of storage mediums and memories.
-
Feature seems nerdy.
Why is counting from 1 to 1024 better than from 1 to 1000? I do not understand this wish. What is wrong on decimal ISO standards? Why is such binary counting better that decimal?My 0b10 ¢
-
@DoctorG said in Option to select binary or decimal units for file sizes:
Feature seems nerdy.
Why is counting from 1 to 1024 better than from 1 to 1000? I do not understand this wish. What is wrong on decimal ISO standards? Why is such binary counting better that decimal?My 0b10 ¢
Because it is the default on all Windows versions and all Ubuntus (maybe all Linux)? And because computer machines calculates in binary?
Not nice to change the way we think since a kid. It is like moving from Celsius to Fahrenheit, from Kilometer to Mile, from English to Spanish, just because someone decided to drop your previous standard, which still exists everywhere.
Luckily, a byte is still 8 bits; I hope don't start saying it is 10 bits, unless machines do actually change. Btw, this is another reason for the binary values.
Btw, on another topic, why do operators sell Internet plans' speed using let's say "1 giga/s" (meaning 1gbps) instead of 125M[i]B/s? Maybe because a bigger number looks cooler, even if it is an artificially inflated number. But you will need to do some calcs to know how fast you'll download a file of XYZ MiB.
Whatever, adding an option seems simpler than discussing all of this. After all, Vivaldi is proud of giving choices to its users, right?
-
@Levrini Hmm, i understand you want to measure the used disk space by MiB instead MB.
I respect this.For me, in real life its makes no sense for mass storage to know the correct size, this 2 percent difference between 1000 and 1024 is less relevant for me.
The only part of world i liked know the correct size, is networking how many packets with how many Bytes the data stream will consume sending or receiving thru Internet.Fortunately we do not have anymore the old times of PDP/11 with magnetic tapes or µC with 64 KByte RAM or CP/M PCs or Apple ][ when i was a kid.
-
@Levrini said in Option to select binary or decimal units for file sizes:
Vivaldi is proud of giving choices to its users
You have much hope to get a option to display in KiB/MiB/TiB.
-
@DoctorG said in Option to select binary or decimal units for file sizes:
how many packets with how many Bytes the data stream will consume sending or receiving thru Internet
Yea, but still some caution on this matter is needed, for example, the size of a packet, or how to convert the bytes consumed into the scale used by the phone company (GB or GiB) to limit your happiness.
-
@Levrini You do not tell much new to a old IT grandma like me
-
Imo, this change was a surprise, and more surprising is that it was implemented without a toggle option.
There are options for many less-impacting things.
Vivaldi takes care for many other nerdy things that most random users may not even care/know about. Even the security/privacy subjects are ignored by most. -
@Levrini Thanks for posting this, I overlooked this change in the 6.2 release notes and only noticed the different behavior now, so I was wondering if this was a bug which should be reported or intentional, and your post was the only reference that I could find.
It's unfortunate that this isn't an exposed preference, especially because the function that formats data sizes does take an optional base argument, whose default value I patched in
bundle.js
to revert to the previous behavior.For anyone else looking for this logic, here is how it appears in 6.9.3447.51:
const mh=[(0,nt.Z)("B"),(0,nt.Z)("kB"),(0,nt.Z)("MB"),(0,nt.Z)("GB"),(0,nt.Z)("TB"),(0,nt.Z)("PB"),(0,nt.Z)("EB"),(0,nt.Z)("ZB"),(0,nt.Z)("YB")],vh=(0,nt.Z)("bytes"); function fh(e,t,n=!0,i=!1){if(isNaN(e))return e?e.toString():"";if(e<=0)return"0 "+(n?vh:mh[0]);const s=i?1024:1e3,o=t??(e<s?0:2);let a=mh.length-1;for(var r=0;r<mh.length;r++)if(e<Math.pow(s,r+1)){a=r;break}let l=(e/Math.pow(s,a)).toLocaleString(void 0,{maximumFractionDigits:o});if(o>0){const e="."+"0".repeat(o);l.endsWith(e)&&(l=l.substring(0,l.length-e.length))}const d=0===a&&n?vh:mh[a];return l+(d?" "+d:"")}
The fourth argument
i
in functionfh
defaults tofalse
, which means base-1000, whiletrue
means base-1024.For those who prefer IEC units (MiB) instead of JEDEC (MB), you can change that
mh
array to get the suffix abbreviations you want.