Improve bytestring docstring.

master
voussoir 2021-11-10 23:02:22 -08:00
parent 691b293939
commit 729d3e5cf3
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 4 additions and 1 deletions

View File

@ -80,10 +80,13 @@ def bytestring(size, decimal_places=3, force_unit=None):
'762.939 MiB' '762.939 MiB'
>>> bytestring(800000000, decimal_places=0) >>> bytestring(800000000, decimal_places=0)
'763 MiB' '763 MiB'
decimal_places:
The number of digits after the decimal, including trailing zeros,
for all divisors except bytes.
force_unit: force_unit:
You can provide one of the size constants to force that divisor.
If None, an appropriate size unit is chosen automatically. If None, an appropriate size unit is chosen automatically.
Otherwise, you can provide one of the size constants to force that divisor.
''' '''
if force_unit is None: if force_unit is None:
divisor = get_appropriate_divisor(size) divisor = get_appropriate_divisor(size)