tbielawa / bitmath

Python module for representing file sizes with different prefix notations
http://bitmath.readthedocs.org/en/latest/
MIT License
91 stars 25 forks source link

best_prefix() returns MiB for Bit rather than Mib #95

Open rohit04saluja opened 3 years ago

rohit04saluja commented 3 years ago

The best_prefix of a bit unit comes as MegaByte. b -> M

How to REPRODUCE the issue:

>>> import bitmath
>>> b = bitmath.Bit(30950093.15655963)
>>> b
Bit(30950093.15655963)
>>> b.best_prefix()
MiB(3.6895386167239703)
>>>

How REPRODUCIBLE (every time? intermittently? only in certain environments?): Happens every time.

What you EXPECTED to happen: The expectation was the best_prefix() should have returned Mib as the initial unit is in Bit.

>>> b.to_Mib()
Mib(29.516308933791763)
>>>

What ACTUALLY happened: best_prefix() returned MiB

>>> b.best_prefix()
MiB(3.6895386167239703)
>>>

VERSION of bitmath effected (git hashes are OK). Did you install from RPM, PyPi, source?

Your OPERATING SYSTEM and the affected PYTHON VERSION:

Python: 3.7.3 OS: Linux 5.4.79-v7+ armv7l GNU/Linux

rohit04saluja commented 8 months ago

@tbielawa any thoughts about it?