mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
[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:
parent
fc77192109
commit
c30178a295
3 changed files with 9 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue