Blogger Information
Blog 19
fans 0
comment 6
visits 19039
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
JS常用函数
葵花宝典
Original
722 people have browsed it

工作中常用到的函数收集到此处,方便查看, 不断更新……..

JS小数取整函数

  1. 丢弃小数部分,保留整数部分
    parseInt(7/2)
  2. 向上取整,有小数就整数部分加1
    Math.ceil(7/2)
  3. 四舍五入
    Math.round(7/2)
  4. 向下取整
    Math.floor(7/2)
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post