1、四舍五入取整 round(value1,value2)
value2默认为0
round(24.1) // 24
round(24.5) // 25
round(24.5,0) // 25
round(24.55321,1) // 24.6
round(24.55321,2) // 24.55
round(24489.55321,-2) // 24500
2、向上取整 ceil(value)
不管小数点后是多少,都将进1
ceil(24.1) // 25
ceil(24.5) // 25
3、向下取整 floor(value)
不管小数点后是多少,都将舍去
floor(24.1) // 24
floor(24.5) // 24
4、转整型 intval(value)
intval(24.13657489) // 24
intval(24.89745379) // 24
intval('helloWorld') // 0 value为纯字符串 运行结果都为0
intval('2a4.4567896') // 2 value为数字与字符串组合 遇到字符串,后面则全部舍去
intval('a24.4567896') // 0