From c40612041809fe289aba58aefa170bbe784aba1f Mon Sep 17 00:00:00 2001 From: t7yang Date: Mon, 10 Jan 2022 08:38:07 +0800 Subject: remove name attribute for zh-CN --- .../web/javascript/reference/global_objects/math/trunc/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/math/trunc') diff --git a/files/zh-cn/web/javascript/reference/global_objects/math/trunc/index.html b/files/zh-cn/web/javascript/reference/global_objects/math/trunc/index.html index 485a96e75d..3568f3bd78 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/math/trunc/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/math/trunc/index.html @@ -12,11 +12,11 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/trunc

Math.trunc() 方法会将数字的小数部分去掉,只保留整数部分。

-

语法

+

语法

Math.trunc(value)
-

参数

+

参数

value
@@ -27,7 +27,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/trunc

给定数字的整数部分

-

描述

+

描述

不像 Math 的其他三个方法: {{jsxref("Math.floor()")}}、{{jsxref("Math.ceil()")}}、{{jsxref("Math.round()")}} ,Math.trunc() 的执行逻辑很简单,仅仅是删除掉数字的小数部分和小数点,不管参数是正数还是负数。

@@ -35,7 +35,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/Math/trunc

因为 trunc()Math 对象的静态方法,你必须用 Math.trunc() 来使用,而不是调用你创建的 Math 对象的一个实例方法(Math 没有构造函数)

-

示例

+

示例

Math.trunc(13.37)    // 13
 Math.trunc(42.84)    // 42
-- 
cgit v1.2.3-54-g00ecf