humanreadable
humanreadable copied to clipboard
Support for size units (Mb, Gb, Tb, Mib, Gib, ...)
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.
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.