เป็น function ที่ ใส่ เครื่อง หมาย , ให้ ตัวเลข ตามตำแหน่งที่ต้องการ
รูปแบบ
string number_format ( float number [, int decimals [, string dec_point, string thousands_sep]] )
ตัวอย่าง
<?php $number = 1234.56; // english notation (default) $english_format_number = number_format($number); // 1,235 // French notation $nombre_format_francais = number_format($number, 2, ',', ' '); // 1 234,56 $number = 1234.5678; // english notation without thousands seperator $english_format_number = number_format($number, 2, '.', ''); // 1234.57 ?> |
http://ptc.meelink.com/function.number-format.html
See also: money_format(), sprintf(), printf() and sscanf().