From d44f5032d0f53256b2d5aef505d6b593fd3cd158 Mon Sep 17 00:00:00 2001 From: Irvin Date: Wed, 16 Feb 2022 02:14:18 +0800 Subject: fix yari h2m dry run errors (zh-CN) --- .../web/javascript/reference/global_objects/parseint/index.html | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'files/zh-cn/web/javascript/reference/global_objects/parseint') diff --git a/files/zh-cn/web/javascript/reference/global_objects/parseint/index.html b/files/zh-cn/web/javascript/reference/global_objects/parseint/index.html index 6dd0b83e6b..d904b20451 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/parseint/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/parseint/index.html @@ -26,8 +26,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/parseInt
string
要被解析的值。如果参数不是一个字符串,则将其转换为字符串(使用  ToString 抽象操作)。字符串开头的空白符将会被忽略。
radix {{optional_inline}}
-
236,表示字符串的基数。例如指定 16 表示被解析值是十六进制数。请注意,10不是默认值!
-
文章后面的描述解释了当参数 radix 不传时该函数的具体行为。
+
236,表示字符串的基数。例如指定 16 表示被解析值是十六进制数。请注意,10不是默认值!文章后面的描述解释了当参数 radix 不传时该函数的具体行为。

返回值

@@ -43,7 +42,7 @@ translation_of: Web/JavaScript/Reference/Global_Objects/parseInt
parseInt('123', 5) // 将'123'看作5进制数,返回十进制数38 => 1*5^2 + 2*5^1 + 3*5^0 = 38
-

描述

+

描述

parseInt函数将其第一个参数转换为一个字符串,对该字符串进行解析,然后返回一个整数或 NaN

@@ -72,8 +71,8 @@ translation_of: Web/JavaScript/Reference/Global_Objects/parseInt

要将一个数字转换为特定的 radix 中的字符串字段,请使用 thatNumber.toString(radix)函数。

-
-

{{jsxref("BigInt")}}。警告: parseInt将 {{jsxref("BigInt")}}转换为{{jsxref("Number")}},并在这个过程中失去了精度。这是因为拖尾的非数字值,包括 "n",会被丢弃。

+
+

警告:{{jsxref("BigInt")}}。警告: parseInt将 {{jsxref("BigInt")}}转换为{{jsxref("Number")}},并在这个过程中失去了精度。这是因为拖尾的非数字值,包括 "n",会被丢弃。

示例

-- cgit v1.2.3-54-g00ecf