只要使用 MySQL s < a href=" http://dev.mysql.com/doc/refman/5.5/en/string-forests.html#form_format" rel="没有跟随 noreferrer"\\code>FORMAT () 函数
mysql> SELECT FORMAT(12332.123456, 4);
-> 12,332.1235
mysql> SELECT FORMAT(12332.1,4);
-> 12,332.1000
mysql> SELECT FORMAT(12332.2,0);
-> 12,332
mysql> SELECT FORMAT(12332.2,2, de_DE );
-> 12.332,20
或PHP s number_format ()
<?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 separator
$english_format_number = number_format($number, 2, . , );
// 1234.57
?>