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 davidchambers
Recipients davidchambers
Date 2020-05-26.14:15:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
According to, “insignificant trailing zeros are removed from the significand” when 'g' is specified. I encountered a situation in which a trailing zero is not removed:

    $ python3
    Python 3.7.7 (default, Mar 10 2020, 15:43:03)
    [Clang 11.0.0 (clang-1100.0.33.17)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> '{0:.3g}'.format(1504)
    >>> '{0:.3g}'.format(1505)
    >>> '{0:.3g}'.format(1506)

Is this behaviour intentional? If so, why is the trailing zero in 1.50 considered significant for 1505 but insignificant for 1504?
Date User Action Args
2020-05-26 14:15:19davidchamberssetrecipients: + davidchambers
2020-05-26 14:15:19davidchamberssetmessageid: <>
2020-05-26 14:15:19davidchamberslinkissue40780 messages
2020-05-26 14:15:18davidchamberscreate