parseInt(3.14159)    => 3

~~3.14159  => 3

 

还有:

向上取整  Math.ceil(3.14159) => 4

向下取整  Math.floor(3.14159) => 3

四舍五入  Math.round(3.14159) => 3

 

相关文章:

  • 2022-12-23
  • 2021-11-20
  • 2021-12-31
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-11
猜你喜欢
  • 2021-11-24
  • 2021-12-24
  • 2022-12-23
  • 2021-10-22
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案