PHP - number_format and rounding

后端 未结 1 1685
长发绾君心
长发绾君心 2021-01-28 13:47

The number_format function in PHP seems to round by default. My understanding is that this function is useful for separating every three numbers with a comma. Lik

1条回答
  •  有刺的猬
    2021-01-28 13:53

    $a=12042.529;
    echo number_format($a,2,'.',',');
    

    0 讨论(0)
提交回复
热议问题