如何显示小数点前三位数字?

How to display three digits before the decimal point?

我想知道如何显示小数点前至少三位数字?

例如:

$nb_badge = "001";
$nb_badge = $nb_badge+6;
echo $nb_badge; // Must display "007".
$nb_badge = sprintf("%03d", $nb_badge);