Using zfill in utils.pad
This commit is contained in:
parent
1f4cdcb8a9
commit
4807072894
|
@ -120,11 +120,7 @@ def setup_args():
|
||||||
return args
|
return args
|
||||||
|
|
||||||
def pad(num, zeroes):
|
def pad(num, zeroes):
|
||||||
s = ""
|
return str(num).zfill(zeroes+1)
|
||||||
for i in range(zeroes,0,-1):
|
|
||||||
if num < 10 ** i:
|
|
||||||
s = f"{s}0"
|
|
||||||
return f"{s}{num}"
|
|
||||||
|
|
||||||
def generate(
|
def generate(
|
||||||
text,
|
text,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user