FORMAT
Format a number. This function formats a number to a format like '#,###,###.##', rounded to a specified number of decimal places.
Syntax
FORMAT(num, decimal_position[, locale])Description
Examples
SELECT FORMAT(1234567890.09876543210, 4) AS 'Format';
+--------------------+
| Format |
+--------------------+
| 1,234,567,890.0988 |
+--------------------+
SELECT FORMAT(1234567.89, 4) AS 'Format';
+----------------+
| Format |
+----------------+
| 1,234,567.8900 |
+----------------+
SELECT FORMAT(1234567.89, 0) AS 'Format';
+-----------+
| Format |
+-----------+
| 1,234,568 |
+-----------+
-- Format number to German number formatting
SELECT FORMAT(123456789,2,'de_DE') AS 'Format';
+----------------+
| Format |
+----------------+
| 123.456.789,00 |
+----------------+Last updated
Was this helpful?

