摘要: $num = 12.678; //第一种:利用round()对浮点数进行四舍五入 转换后类型 float echo round($num,2); //12.68//第二种:利用sprintf格式化字符串 转换类型string 不能运算 $format_num = sprintf("%.2f",$num); echo $format_num; /... 阅读全文
posted @ 2019-02-23 10:49 志远丶 阅读(267) 评论(0) 推荐(0) 编辑