This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients Kwpolska, eric.smith, mark.dickinson
Date 2020-11-23.12:56:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Hmm. I'm not sure that it ever got documented properly. There may still be an open documentation issue somewhere.

There's not really much wiggle-room for changing the implementation: the behaviour of the "g" formatting for Decimal objects is following the specification of "to-scientific-string" from the Decimal Arithmetic spec that the decimal module is based on:

One of the principles articulated there is that to-scientific-string should be faithful, so that conversion to string and back doesn't lose any information. That precludes chopping significant trailing zeros.
Date User Action Args
2020-11-23 12:56:33mark.dickinsonsetrecipients: + mark.dickinson, eric.smith, Kwpolska
2020-11-23 12:56:33mark.dickinsonsetmessageid: <>
2020-11-23 12:56:33mark.dickinsonlinkissue42429 messages
2020-11-23 12:56:32mark.dickinsoncreate