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).
There seems to be a rounding bug when using the binary option:
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).