Skip to content

floatfmt doesn't work when tablefmt="pretty" #71

@TalAmuyal

Description

@TalAmuyal

Reproduced with tabulate==0.8.7

import tabulate


table = tabulate.tabulate(
    [
        [1.10000001],
    ],
    tablefmt="pretty",
    floatfmt=".3f",
)

print(table)

yields

+------------+
| 1.10000001 |
+------------+

instead of

+-------+
| 1.100 |
+-------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions