Skip to content

Commit 20b878b

Browse files
committed
seq: Fix seq -w 0 0
1 parent 9420773 commit 20b878b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

userland/utilities/seq.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def arg_to_decimal(arg: str) -> Decimal:
6060

6161
if len(args) == 1:
6262
last = arg_to_decimal(args[0])
63-
if not last:
63+
if last == 0:
6464
return 0
6565

6666
first = Decimal(1)
@@ -90,7 +90,7 @@ def arg_to_decimal(arg: str) -> Decimal:
9090
formatstr: str
9191

9292
if opts.equal_width:
93-
padding = math.floor(math.log10(last))
93+
padding = 0 if last == 0 else math.floor(math.log10(last))
9494
padding += -exponent + 2 if exponent else 1
9595
if first < 0 or last < 0:
9696
padding += 1

0 commit comments

Comments
 (0)