File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -206,16 +206,16 @@ another rational number, or from a string.
206
206
207
207
Here are some examples::
208
208
209
- >>> from fractions import Fraction
210
- >>> format (Fraction(1 , 7 ), ' .40g' )
211
- '0.1428571428571428571428571428571428571429'
212
- >>> format (Fraction(' 1234567.855' ), ' _.2f' )
213
- '1_234_567.86'
214
- >>> f " { Fraction(355 , 113 ):* > 20. 6e } "
215
- '********3.141593e+00'
216
- >>> old_price, new_price = 499 , 672
217
- >>> " {:.2% } price increase" .format(Fraction(new_price, old_price) - 1 )
218
- '34.67% price increase'
209
+ >>> from fractions import Fraction
210
+ >>> format(Fraction(1, 7), '.40g')
211
+ '0.1428571428571428571428571428571428571429'
212
+ >>> format(Fraction('1234567.855'), '_.2f')
213
+ '1_234_567.86'
214
+ >>> f"{Fraction(355, 113):*>20.6e}"
215
+ '********3.141593e+00'
216
+ >>> old_price, new_price = 499, 672
217
+ >>> "{:.2%} price increase".format(Fraction(new_price, old_price) - 1)
218
+ '34.67% price increase'
219
219
220
220
221
221
.. seealso ::
You can’t perform that action at this time.
0 commit comments