摘要: $num = 10.4567; //第一种:利用round()对浮点数进行四舍五入 echo round($num,2); //10.46 //第二种:利用sprintf格式化字符串 $format_num = sprintf("%.2f",$num); echo $format_num; //10 阅读全文
posted @ 2020-08-14 09:29 study_php_java_C++ 阅读(2770) 评论(0) 推荐(0) 编辑