-
- /**1.number_format*/
- $number = 1234.56789;
- $nombre_format_francais = number_format($number, 2, ',', ' ');
- $english_format_number = number_format($ number, 2, '.', '');
-
-
- /**2.round*/
- $number = 1234.56789;
- echo round($number ,2);
-
-
- /**3.sprintf*/
- $formatted = sprintf ("¥%01.2f.", $money);
- echo $formatted;
-
- ?>
Copy code
|
Several digits, rounding, PHP