[3.13] gh-130664: Treat '0' fill character with align '=' as zero-padding for Fraction's (GH-131067) (GH-136242)

(cherry picked from commit c113a8e523)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-07-03 13:20:49 +02:00 committed by GitHub
parent fc77192109
commit c30178a295
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 5 deletions

View file

@ -481,6 +481,9 @@ def _format_float_style(self, match):
trim_point = not alternate_form
exponent_indicator = "E" if presentation_type in "EFG" else "e"
if align == '=' and fill == '0':
zeropad = True
# Round to get the digits we need, figure out where to place the point,
# and decide whether to use scientific notation. 'point_pos' is the
# relative to the _end_ of the digit string: that is, it's the number