FORMAT(X,D): Formats the number X to a format like '#,###,###.##' : FORMAT « String Functions « MySQL Tutorial






Rounds X to D decimal places.

Returns the result as a string.

If D is 0, the result has no decimal point or fractional part.

mysql>
mysql> SELECT FORMAT(12332.123456, 4);
+-------------------------+
| FORMAT(12332.123456, 4) |
+-------------------------+
| 12,332.1235             |
+-------------------------+
1 row in set (0.00 sec)

mysql>








23.14.FORMAT
23.14.1.FORMAT(X,D): Formats the number X to a format like '#,###,###.##'
23.14.2.FORMAT(12332.1,4);
23.14.3.FORMAT(12332.2,0)
23.14.4.Using FORMAT with data in a table