utils
Utils functions
Imports
Constants
Utils
format
format (size:int=1, base:int=1000, sep:Optional[str]=' ', precision:Optional[int]=1, units:Iterable=('byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte', 'petabyte', 'exabyte', 'zettabyte', 'yottabyte'))
getnum
getnum (size:int=1, base:int=1000, precision:Optional[int]=1, units:Iterable=('byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte', 'petabyte', 'exabyte', 'zettabyte', 'yottabyte'))
Returns the unit suffix for a given size and base
getsuf
getsuf (size:int=1, base:int=1000, units:Iterable=('byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte', 'petabyte', 'exabyte', 'zettabyte', 'yottabyte'))
Returns the unit suffix for a given size and base
getexp
getexp (size:int=1, base:int=1000, units:Iterable=('byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte', 'petabyte', 'exabyte', 'zettabyte', 'yottabyte'))
Gets the power of the unit for a given size and base
getidx
getidx (size:int=1, base:int=1000, units:Iterable=('byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte', 'petabyte', 'exabyte', 'zettabyte', 'yottabyte'))
Gets the index of the unit for a given size and base