JavaScript中的Number.toExponential()函数
toExponential()Number对象的函数返回一个以指数表示形式表示数字对象的字符串。
语法
其语法如下
var num=77.1234;
num.toExponential('0xF', 16);示例
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var num = 77.1234;
document.write( num.toExponential(4));
document.write("<br>");
var num = 77.1234;
document.write(num.toExponential());
document.write("<br>");
var num = 77.1234;
var num = 77.1234;
document.write(num.toExponential(0));
</script>
</body>
</html>输出结果
7.7123e+1 7.71234e+1 8e+1
热门推荐
10 写给兄弟的祝福语简短
11 中秋祝福语给父亲简短
12 关云生字祝福语简短
13 2026年祝福语大全简短
14 给司机老师祝福语简短
15 舞台上祝福语大全简短
16 婚礼亲友祝福语简短幽默
17 姐妹结婚红包简短祝福语
18 班级群毕业祝福语简短