astanin / python-tabulate

Pretty-print tabular data in Python, a library and a command-line utility. Repository migrated from bitbucket.org/astanin/python-tabulate.
https://pypi.org/project/tabulate/
MIT License
2.1k stars 163 forks source link

intfmt and setlocale #284

Open aborruso opened 1 year ago

aborruso commented 1 year ago

Hi, I need to have integer number in Italian representation, in which the thousand separator is the .. For 9200, in Italy we have 9.200.

If run print(tabulate([["a",9200]], intfmt=",")) I have 9,200, but if I set intfmt="." I have ValueError: Format specifier missing precision error.

Is there a way to set locale.setlocale(locale.LC_ALL, 'it_IT.UTF-8') and use it to render 9200 int as 9.200?

Thank you