-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve Float Subclass #361
Comments
After patching that I also found that the default |
I also had to generalize the
|
Numbers are cast to
float
beforeformat()
ing, which prevents custom formatting logic provided by subclasses. tabulate/__init__.py#L1350Example
Background
Proposals to extend the built-in python formats have been rejected, because subclasses are intended to satisfy this use case.
https://discuss.python.org/t/new-format-specifiers-for-string-formatting-of-floats-with-si-and-iec-prefixes/26914/6
This regression was introduced in version
0.2
. 5115cea/tabulate.py#L154Related to #297.
Proposal
Only apply the
float
cast in_format()
to strings.Edit: And
decimal
align any string by.
or\d([^d])
in_afterpoint()
.The text was updated successfully, but these errors were encountered: