filesize icon indicating copy to clipboard operation
filesize copied to clipboard

Bug: result is incorrect for certain sizes

Open orenwang opened this issue 3 years ago • 0 comments

More specifically, when the size is larger than 1024 MB but is divisible by 1024 for example, the result would always be 1 GB.

The code below shows this clearer:

filesize(1073741824);          // "1 GB"
filesize(1173741825);          // "1.09 GB"
filesize(1297092608);          // "1 GB"

I will file a pull request soon if I have time.

orenwang avatar Sep 23 '21 07:09 orenwang