Pretty-print tabular data in Python, a library and a command-line utility. Repository migrated from bitbucket.org/astanin/python-tabulate.
2.1k
stars
163
forks
source link
problem aligning floats with trains zeros #249
Open
varioustoxins opened 1 year ago
I am trying to format a table with floating point numbers with a fixed number of trailing decimals including zeros (including redundant zeros)
so I want something like
however, if I add the numbers to the rows as floats this doesn't seem to work even if I specify
floatfmt='7.3'
andnumalign ='decimals'
as this gives:
note the badly aligned zeros in row 2 column CB
so I end up using
format(shift_value, '7.3f')
to convert the numbers to strings before I append them to the rows in. the table andto tabulate the table
is there a better way, is the zeros problem a bug?