There seems to be a rounding bug when using the binary option:
Input | Actual output | Expected output |
---|---|---|
1001 | 1000 B | 1001 B |
1023 | 1020 B | 1023 B |
1037263 | 1010 KiB | 1013 KiB |
1051013543 | 1000 MiB | 1002 MiB |
1054331017 | 1010 MiB | 1005 MiB |
Code:
prettyBytes(input, {binary: true})
It appears that the number is rounded to a multiple of ten.
It looks like this only happens for outputs between 1001 and 1023 (inclusive).
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too