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
floatfmt with a padded number and comma separate doesn't align around decimal place #248
Open
Naton1 opened 1 year ago
Best shown with an example:
The numbers in the first column aren't aligned by the decimal place.
If I remove the comma (so
'17.4f'
), it works:I believe it's because the regex at https://github.com/astanin/python-tabulate/blob/master/tabulate/__init__.py#L774 does not support whitespace before the number so
_isnumber_with_thousands_separator
returns False, although_isnumber
works fine for numbers left-padded with whitespace