> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# money_format

> 将数字按照货币格式输出，整数部分每隔3位用逗号分隔，小数部分保留2位。

将数字按照货币格式输出，整数部分每隔 3 位用逗号分隔，小数部分保留 2 位。

## 语法

```Haskell theme={null}
money_format(num)
```

## 参数说明

`num`: 支持的数据类型为 NUMBER。

## 返回值说明

返回值的数据类型为 VARCHAR。

## 示例

```Plain Text theme={null}
MySQL > select money_format(17014116);
+------------------------+
| money_format(17014116) |
+------------------------+
| 17,014,116.00          |
+------------------------+

MySQL > select money_format(1123.456);
+------------------------+
| money_format(1123.456) |
+------------------------+
| 1,123.46               |
+------------------------+

MySQL > select money_format(1123.4);
+----------------------+
| money_format(1123.4) |
+----------------------+
| 1,123.40             |
+----------------------+
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.