progressbar icon indicating copy to clipboard operation
progressbar copied to clipboard

Bad size value with (fs.FileInfo).Size() on parameter

Open nacimgoura opened this issue 2 years ago • 1 comments

Hello, thanks for this library. I use this to have a progress bar when I read a file, but I have a little bug. I call file.Stat() to have the file size and I put on progressbar. image The problem is that the size value I pass as a parameter and the size displayed in the progress bar are not the same. The size file is 159MB but the progress bar display 152MB. image

I don't know why this difference exist.

Also, If i call bar.Finish() on the end of my process, the total size become huge. image

nacimgoura avatar Jun 21 '23 07:06 nacimgoura

The discrepancy between 159MB vs 152MB is because the actual size of the file is 159MB and 152MiB. This library shows things in bibytes instead of bytes. Given most things use KB/MB/GB/TB/PB instead of KiB/MiB/GiB/TiB/PiB, it should probably use those units instead.

pdevine avatar Jul 19 '23 22:07 pdevine