Eric V. Smith <e...@trueblade.com> added the comment:
A few things: - There is no %-formatting for Decimal types. They're being converted to float first. That's why it appears that %-formatting with 'g' works the same for decimal and float: you're really just calling the float version. - The difference in 'g' formatting between float and Decimal is a known difference. This issue pops up every now and again, but right now I can't find where (or if) it's actually documented. Mark: can you point to it? I don't think https://docs.python.org/3/library/string.html#format-specification-mini-language mentions it where it talks about Decimals. And I don't see any documentation for Decimal.__format__. ---------- nosy: +eric.smith, mark.dickinson _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue42429> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com