MONEY_FORMAT
Descriptionβ
The number is output in currency format, the integer part is separated by commas every three bits, and the decimal part is reserved for two bits.
Syntaxβ
MONEY_FORMAT(<number>)
Parametersβ
Parameter | Description |
---|---|
<number> | The numbers to be formatted |
Return valueβ
Returns a string in currency format. Special cases:
- If the parameter is NULL, return NULL
Exampleβ
select money_format(17014116);
+------------------------+
| money_format(17014116) |
+------------------------+
| 17,014,116.00 |
+------------------------+
select money_format(1123.456);
+------------------------+
| money_format(1123.456) |
+------------------------+
| 1,123.46 |
+------------------------+
select money_format(1123.4);
+----------------------+
| money_format(1123.4) |
+----------------------+
| 1,123.40 |
+----------------------+