@@ -103,7 +103,8 @@ another rational number, or from a string.
103
103
104
104
.. versionchanged :: 3.12
105
105
:class: `Fraction ` instances now support float-style formatting, with
106
- presentation types `"e" `, `"E" `, `"f" `, `"F" `, `"g" `, `"G" ` and `"%"" `.
106
+ presentation types ``"e" ``, ``"E" ``, ``"f" ``, ``"F" ``, ``"g" ``, ``"G" ``
107
+ and ``"%"" ``.
107
108
108
109
.. attribute :: numerator
109
110
@@ -196,12 +197,12 @@ another rational number, or from a string.
196
197
This method provides support for float-style formatting of
197
198
:class: `Fraction ` instances via the :meth: `str.format ` method, the
198
199
:func: `format ` built-in function, or :ref: `Formatted string literals
199
- <f-strings>`. The presentation types `"e" `, `"E" `, `"f" `, `"F" `, ` "g" `,
200
- `" G"`` and `"%" ` are supported. For these presentation types, formatting
201
- for a :class: `Fraction ` object `x ` behaves as though the object ` x ` were
202
- first converted to :class: `float ` and then formatted using the float
203
- formatting rules, but avoids the loss of precision that might arise as
204
- a result of that conversion.
200
+ <f-strings>`. The presentation types `` "e" `` , `` "E" `` , `` "f" `` , `` "F" ``,
201
+ `` "g" ``, `` " G" `` and `` "%" `` are supported. For these presentation types,
202
+ formatting for a :class: `Fraction ` object `x ` behaves as though the
203
+ object ` x ` were first converted to :class: `float ` and then formatted
204
+ using the float formatting rules, but avoids the loss of precision that
205
+ might arise as a result of that conversion.
205
206
206
207
Here are some examples::
207
208
0 commit comments