a8m / angular-filter

Bunch of useful filters for AngularJS (with no external dependencies!)
https://github.com/a8m/angular-filter
MIT License
2.93k stars 332 forks source link

KiB and MiB are wrongly used in place of kB and MB #254

Open evilaliv3 opened 7 years ago

evilaliv3 commented 7 years ago

The current implementation for byteFmt and kbFmt is using KiB(kibibyte) and MiB (mebibyte) are wrongly used in place of kB(kilobyte) and MB (megabyte).

The issue should be fixed in compatibility with the most common convension of softwares like the linux filesystem, chrome, firefox.

Evidences of the issue are present on the following ticket: https://github.com/globaleaks/GlobaLeaks/issues/2044

A diffuse explaination is present on the wikipedia page: https://en.wikipedia.org/wiki/Kilobyte

image

evilaliv3 commented 7 years ago

In the real only linux and mac use the correct Kb definitions while Microsoft still use the 1024 size so that it is not possible to obtain something completely "correct".

nmoinvaz commented 7 years ago

It might be better to modify the filters to take a second parameter which is the base 10 or 2.