Skip to content

Commit bcd828e

Browse files
committed
better alignment
1 parent 9d68044 commit bcd828e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

xdeps/table.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def _to_str(arr, digits, fixed="g", max_len=None):
4040
# Format floats.
4141
# First generate a format string like "%.<digits>g", then use it on
4242
# each element.
43-
fmt = "%%.%d%s" % (digits, fixed)
43+
add = 3 if fixed=='f' else 7
44+
fmt = "%%%d.%d%s" % (digits+add, digits, fixed)
4445
out = np.char.mod(fmt, arr)
4546
elif arr.dtype.kind == "O" and isinstance(arr[0], Collection):
4647
# If array of collections (array with dtype=object) or list, give shape

0 commit comments

Comments
 (0)