// 小数点相加不丢失精度 $a = 0.12; $b = 0.711; var_dump(bcadd($a,$b,2));
$num = 10.464; echo number_format($num, 2); //10.46
//利用round()对浮点数进行四舍五入 echo round($num,2); //10.46