Use divmod
This commit is contained in:
parent
c1d4b26c6c
commit
d68d77e6d5
|
@ -92,15 +92,14 @@ class Summary(object):
|
||||||
if remainder < s or remainder == 0:
|
if remainder < s or remainder == 0:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
exact = remainder // s
|
exact, remainder = divmod(remainder, s)
|
||||||
remainder = remainder % s
|
|
||||||
if exact > 1:
|
if exact > 1:
|
||||||
time_string += f"{exact} {st}s, "
|
time_string += f"{exact} {st}s, "
|
||||||
else:
|
else:
|
||||||
time_string += f"{exact} {st}, "
|
time_string += f"{exact} {st}, "
|
||||||
if truncate:
|
if truncate:
|
||||||
break
|
break
|
||||||
return time_string.strip().strip(',')[::-1].replace(' ,', ' dna ', 1)[::-1]
|
return time_string.strip().strip(',')[::-1].replace(' ,', ' dna ', 1)[::-1] # lmao
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def bytes_to_string(bytes: int):
|
def bytes_to_string(bytes: int):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user