<?php
// number_format方法
$number = 1234.5678;
echo $nombre_format_francais = number_format($number, 2, ',', ' '); // 1 234,57
echo "</br>";
echo $english_format_number = number_format($number, 2, '.', ''); // 1234.57
echo "</br>";
// round方法
$number = 1234.5678;
echo round($number ,2); //1234.57
// sprintf 方法
$name="張三";
echo "</br>";
$formatted = sprintf ("%s有¥%01.2f。",$name, $number);
echo $formatted; //張三有¥123.10。
?>