php 的 number_format使用

$num = 1.0258963147;

// 1.0259
$num = number_format($num, 4, '.', '');

// 1
$num = number_format($num);


$num = 50000;

// 50,000
$num = number_format($num);

// 50000.00
$num = number_format($num, 2, '.', '');
原文地址:https://www.cnblogs.com/arvin-an/p/9133052.html