Skip to main content

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​

ParameterDescription
<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 |
+----------------------+