JavaScript 中的 Number.toString() 函数
htmljavascriptprogramming scripts更新于 2024/10/13 8:12:17
Number 对象的 toString() 函数接受一个数字并返回给定数字的字符串表示形式。
语法
其语法如下
num.toString(num);
示例
<html>
<head>
<title>JavaScript 示例</title>
</head>
<body>
<script type="text/javascript">
var num = 215;
result = num.toString(16);
document.write("结果: " + result);
</script>
</body>
</html>
输出
结果: d7
相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

