humanreadable icon indicating copy to clipboard operation
humanreadable copied to clipboard

Support for size units (Mb, Gb, Tb, Mib, Gib, ...)

Open fgvieira opened this issue 2 years ago • 1 comments

Would it be possible to also support size units?

I am looking to convert any string (e.g. "64 Gb") into megabytes.

I guess i need something similar to https://stackoverflow.com/questions/1094841/get-human-readable-version-of-file-size or https://stackoverflow.com/questions/12523586/python-format-size-application-converting-b-to-kb-mb-gb-tb, but more general that can convert any size unit to any other.

fgvieira avatar Jul 17 '23 10:07 fgvieira

That is possible. However, that will need to create a new class like Byte. Implementation would be relatively easy by diverting the BitsPerSecond class that already implements similar logic.

thombashi avatar Jul 22 '23 15:07 thombashi