
toLocaleString() 方法返回当前数字的字符串值版本,其格式可能会根据浏览器的本地设置而有所不同。
示例
您可以尝试运行以下代码来返回字符串值版本 -
<html>
<head>
<title>JavaScript toLocaleString() Method </title>
</head>
<body>
<script>
var num = new Number(150.1234);
document.write( num.toLocaleString());
</script>
</body>
</html>










