mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-130664: Treat '0' fill character with align '=' as zero-padding for Fraction's (GH-131067)
This commit is contained in:
parent
5c984ae35e
commit
c113a8e523
3 changed files with 9 additions and 5 deletions
|
@ -504,6 +504,9 @@ class Fraction(numbers.Rational):
|
|||
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