语法高亮,滚动条美化,设置页面调整

This commit is contained in:
fofolee
2019-04-19 02:41:09 +08:00
parent 1e8f76c000
commit 359d29ee0b
1590 changed files with 12328 additions and 11441 deletions

View File

@@ -3,7 +3,7 @@
<p><code><strong>toFixed()</strong></code> 方法使用定点表示法来格式化一个数。</p>
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/number-tofixed.html" width="100%"></iframe></div>
<h2 id="Syntax" name="Syntax">语法</h2>
<pre class="syntaxbox"><code><em>numObj</em>.toFixed(<em>digits</em>)</code></pre>
<pre><code class="language-javascript"><code><em>numObj</em>.toFixed(<em>digits</em>)</code></code></pre>
<h3 id="Parameter" name="Parameter">参数</h3>
<dl>
<dt>digits</dt>
@@ -24,7 +24,7 @@
<p><font face="Open Sans, sans-serif">一个数值的字符串表现形式,不使用指数记数法,而是在小数点后有 digitsdigits具体值取决于传入参数位数字。</font>该数值在必要时进行四舍五入,另外在必要时会用 0 来填充小数部分,以便小数部分有指定的位数。 如果数值大于 1e+21该方法会简单调用 <a href="Reference/Global_Objects/Number/toString" title="toString() 方法返回指定 Number 对象的字符串表示形式。"><code>Number.prototype.toString()</code></a>并返回一个指数记数法格式的字符串。</p>
<h2 id="Example" name="Example">示例</h2>
<h3 id="使用_toFixed">使用 <code>toFixed</code></h3>
<pre class="brush: js">var numObj = 12345.6789;
<pre><code class="language-javascript">var numObj = 12345.6789;
numObj.toFixed(); // 返回 "12346":进行四舍五入,不包括小数部分
numObj.toFixed(1); // 返回 "12345.7":进行四舍五入
@@ -41,7 +41,7 @@ numObj.toFixed(6); // 返回 "12345.678900"用0填充
(-2.34).toFixed(1); // 返回 "-2.3" (若用括号提高优先级,则返回字符串)
</pre>
</code></pre>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>