php 四捨六入(銀行家舍入)實現

項目中要用到銀行家舍入方法,php沒有現成的方法,因此寫了一個php function up6down4($num,$n){ $pow = pow(10,$n); $con_a = floor(round($num * $pow * 10,1)); $con_b = floor(round($num * $pow,1)); $con_c = ($num * $p
相關文章
相關標籤/搜索