Consider adjusting how file sizes are displayed (binary v. decimal definition of a byte display incongruity)
Categories
(Firefox for Android :: Design System and Theming, task)
Tracking
()
People
(Reporter: olivia, Unassigned)
References
Details
Attachments
(1 file)
|
151.53 KB,
image/jpeg
|
Details |
Fenix is calculating file sizes using the binary definition of a byte (1024), but displaying them using decimal definition of a byte.
For example, translations is displaying 17.2 MB for a model size, but to be perfectly correct, it is 17.2 MiB based on the calculation.
The calculation originates from DownloadDialogFragment and seems to be used in many places.
I think I've seen this reported before for other scenarios, but couldn't find a ticket.
I suspect this bug will mostly be collaborating with UX and L10N to confirm if we want to change conventions. According to this, it sounds like the US locale at least should be following the binary definition of a byte.
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 1•1 year ago
|
||
Just to clarify the issue:
- Raw value is 17972343 bytes
- Fenix displays 17.2 MB <- this is incorrect, the calculation + units don't match
- Format is of the form: [binary calculation] + [decimal units notation]
- The correct display should be either:
- 17.2 MiB (binary definition)
- 17.97 MB (decimal definition)
| Reporter | ||
Comment 2•1 year ago
|
||
This has likely been fixed for many areas by bug 1951907. Would need to spot check raw bytes v. displayed format to be sure.
Cross-posting this comment from Bug 1953923 for visibility,
I just took a look into this! This new method seems to be calculating (and displaying) the decimal definition of a byte. I changed Translations to be using this new method and the preview changed from showing 3.91MB (should be MiB) to 4 MB, which is the correct conversion from 4000 bytes. After I land this, I can ask QA to verify if Bug 1948059 is fixed.
Update: This is not always the case. From the documentation,
In android. os. Build. VERSION_CODES. N and earlier, powers of 1024 are used instead, with KB = 1024 bytes, MB = 1,048,576 bytes, etc.
Since the patches for Bug 1953923 and Bug 1951907 have landed, can QA please verify that we now calculate and display file sizes with the decimal definition of a byte? This can be verified by going to http://xcal1.vodafone.co.uk/ and trying to download any of the files. Notice that this website uses the base 2 definition of a byte. I.e. KB = 1024 bytes, MB = 1,048,576 bytes, etc... This means that if trying to download a 5MB file, it is really a 5MiB file and our downloads page and dialogs should really be showing 5.24 MB
Comment 5•1 year ago
|
||
Verified as fixed in latest Nightly from 0/25 with Google Pixel 8 Pro (Android 15). The file size is displayed with the decimal definition of a byte.
Updated•1 year ago
|
Updated•1 year ago
|
Description
•