PHP数学运算: 向上/向下取整及四舍五入

Categories: PHP; Tagged with: ; @ September 9th, 2010 22:11

1. ceil 向上取整
2. floor 向下取整
3. round 四舍五入
4.intval 转为整数

实例:

$value= 5.1;
echo ceil($value); // 6
echo floor($value); // 5
echo round($value); // 5
echo intval($value); // 5

<->



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.