W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<html> <head> <script type="text/javascript"> function displaynum() { var num = new Number(13.37); alert(num.toFixed(1)); } </script> </head> <body> Show the number 13.37 with one decimal: <form> <input type="button" value="Show!" onclick="displaynum()" > </form> </body> </html>