javaScript常用数学方法 Posted on 2018-03-05 | Edited on 2020-02-03 | In JavaScript | Comments: | Views: > floor()1234// 向下取整Math.floor(2.1) // 2Math.floor(2.6) // 2Math.floor(-2.6) // -3 ceil()1234// 向上取整Math.ceil(2.1) // 3Math.ceil(2.6) // 3Math.ceil(-2.1) // -2 round()1234Math.round(3.14) //3Math.round(3.5) //4Math.round(-3.14) //-3Math.round(-3.5) //-3 Post author: webkong Post link: https//blog.webkong.cn/javascript常用数学方法/ Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.