diff options
| author | t7yang <t7yang@gmail.com> | 2022-01-10 08:38:07 +0800 |
|---|---|---|
| committer | Irvin <irvinfly@gmail.com> | 2022-02-16 02:35:54 +0800 |
| commit | c40612041809fe289aba58aefa170bbe784aba1f (patch) | |
| tree | 8ca89b071d04afcf7abd6d9a04d0765a041d9c8a /files/zh-cn/web/javascript/reference/global_objects/math/round | |
| parent | 12a899ab8540bc84f56a0dc6491be80a48499d49 (diff) | |
| download | translated-content-c40612041809fe289aba58aefa170bbe784aba1f.tar.gz translated-content-c40612041809fe289aba58aefa170bbe784aba1f.tar.bz2 translated-content-c40612041809fe289aba58aefa170bbe784aba1f.zip | |
remove name attribute for zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/math/round')
| -rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/math/round/index.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/math/round/index.html b/files/zh-cn/web/javascript/reference/global_objects/math/round/index.html index 409b9dbaa1..8cc263a27d 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/math/round/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/math/round/index.html @@ -10,11 +10,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/round <p><code><strong>Math.round()</strong></code> 函数返回一个数字四舍五入后最接近的整数。</p> -<h2 id="Syntax" name="Syntax">语法</h2> +<h2 id="Syntax">语法</h2> <pre class="syntaxbox"><code>Math.round(<em>x</em>) </code></pre> -<h3 id="Parameters" name="Parameters">参数</h3> +<h3 id="Parameters">参数</h3> <dl> <dt><code>x</code></dt> @@ -26,13 +26,13 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/round </dt> </dl> -<h2 id="Description" name="Description">描述</h2> +<h2 id="Description">描述</h2> <p>如果参数的小数部分大于 0.5,则舍入到相邻的绝对值更大的整数。 如果参数的小数部分小于 0.5,则舍入到相邻的绝对值更小的整数。如果参数的小数部分恰好等于0.5,则舍入到相邻的在正无穷(+∞)方向上的整数。<strong>注意,与很多其他语言中的<code>round()函数</code>不同,<code>Math.round()并不总是舍入到远离0的方向(尤其是在负数的小数部分恰好等于0.5的情况下)。</code></strong></p> <p>因为 <code>round()</code> 是 <code>Math</code> 的静态方法,你应该直接使用 <code>Math.round()</code>,而不是作为你创建的 <code>Math</code> 对象的一个实例方法来使用(<code>Math</code>没有构造函数)。</p> -<h2 id="Examples" name="Examples">示例</h2> +<h2 id="Examples">示例</h2> <pre class="brush:js">x = Math.round(20.49); //20 x = Math.round(20.5); //21 @@ -40,7 +40,7 @@ x = Math.round(-20.5); //-20 x = Math.round(-20.51); //-21 </pre> -<h3 id="Example:_Decimal_rounding" name="Example:_Decimal_rounding">小数舍入</h3> +<h3 id="Example:_Decimal_rounding">小数舍入</h3> <pre class="brush: js">// 闭包 (function(){ @@ -203,7 +203,7 @@ round(1.005, 2); //1.01 </table> </div> -<h2 id="See_also" name="See_also">相关链接</h2> +<h2 id="See_also">相关链接</h2> <p></p> |
