<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>判断一个数字是整数还是小数</title>
</head>

<body>
<div id="box"></div>
<script type="text/javascript">
var number=123.456
if(parseInt(number)==number){
    alert('是整数');
}else{
    alert('不是整数');
}

</script>
</body>
</html>

 

相关文章:

  • 2022-12-23
  • 2021-05-19
  • 2021-12-24
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
猜你喜欢
  • 2021-12-05
  • 2022-12-23
  • 2021-06-24
  • 2021-05-21
  • 2022-12-23
  • 2021-10-09
相关资源
相似解决方案