jquery 四舍五入

  

  1. alert(Math.ceil(10/3));//4                Math.ceil()用作向上取整。  
  2. alert(Math.floor(10/3));//3              Math.floor()用作向下取整
  3. alert(Math.round(10/3));//3            我们数学中常用到的四舍五入取整。  
posted @ 2016-04-21 16:35  awake-insist  Views(569)  Comments(0)    收藏  举报