mirror of https://github.com/flaggo/pydu.git
16 lines
363 B
ReStructuredText
16 lines
363 B
ReStructuredText
|
Unit
|
||
|
----
|
||
|
|
||
|
.. py:class:: pydu.unit.Bytes(bytes)
|
||
|
|
||
|
Supply several methods dealing with bytes.
|
||
|
|
||
|
.. py:method:: convert(self, unit=None, multiple=1024)
|
||
|
|
||
|
Convert bytes in give ``unit``.
|
||
|
If ``unit`` is None, convert bytes in suitable unit.
|
||
|
Convert ``multiple`` is default to be 1024.
|
||
|
|
||
|
>>> Bytes(1024).convert()
|
||
|
(1, 'KB')
|