You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and <codeclass="docutils literal notranslate"><spanclass="pre">"%"</span></code> are supported. For these presentation types, formatting for a
414
414
<aclass="reference internal" href="#fractions.Fraction" title="fractions.Fraction"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">Fraction</span></code></a> object <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> follows the rules outlined for
415
-
the <aclass="reference internal" href="functions.html#float" title="float"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">float</span></code></a> type in the <aclass="reference internal" href="string.html#formatspec"><spanclass="std std-ref">格式規格 (Format Specification) 迷你語言</span></a> section.</p>
415
+
the <aclass="reference internal" href="functions.html#float" title="float"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">float</span></code></a> type in the <aclass="reference internal" href="string.html#formatspec"><spanclass="std std-ref">Format Specification Mini-Language</span></a> section.</p>
Copy file name to clipboardExpand all lines: library/functions.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -814,7 +814,7 @@ <h3>瀏覽</h3>
814
814
<dlclass="py function" id="index-4">
815
815
<dtclass="sig sig-object py" id="format">
816
816
<spanclass="sig-name descname"><spanclass="pre">format</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">value</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">format_spec</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">''</span></span></em><spanclass="sig-paren">)</span><aclass="headerlink" href="#format" title="Link to this definition">¶</a></dt>
Copy file name to clipboardExpand all lines: library/stdtypes.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6007,7 +6007,7 @@ <h3>Affected APIs<a class="headerlink" href="#affected-apis" title="Link to this
6007
6007
<li><p><code class="docutils literal notranslate"><span class="pre">int(string,</span> <span class="pre">base)</span></code> with base 2, 4, 8, 16, or 32.</p></li>
@@ -440,7 +440,7 @@ <h2>String constants<a class="headerlink" href="#string-constants" title="Link t
440
440
The <em>field_name</em> is optionally followed by a <em>conversion</em> field, which is
441
441
preceded by an exclamation point <codeclass="docutils literal notranslate"><spanclass="pre">'!'</span></code>, and a <em>format_spec</em>, which is preceded
442
442
by a colon <codeclass="docutils literal notranslate"><spanclass="pre">':'</span></code>. These specify a non-default format for the replacement value.</p>
<spanid="formatspec"></span><h3>格式規格 (Format Specification) 迷你語言<aclass="headerlink" href="#format-specification-mini-language" title="Link to this heading">¶</a></h3>
<spanid="formatspec"></span><h3>Format Specification Mini-Language<aclass="headerlink" href="#format-specification-mini-language" title="Link to this heading">¶</a></h3>
503
+
<p>"Format specifications" are used within replacement fields contained within a
504
+
format string to define how individual values are presented (see
<aclass="reference internal" href="functions.html#format" title="format"><codeclass="xref py py-func docutils literal notranslate"><spanclass="pre">format()</span></code></a> function. Each formattable type may define how the format
508
+
specification is to be interpreted.</p>
504
509
<p>Most built-in types implement the following options for format specifications,
505
510
although some of the formatting options are only supported by the numeric types.</p>
506
511
<p>A general convention is that an empty format specification produces
0 commit comments