money_format

description

Syntax

VARCHAR money_format(Number)

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

example

  1. mysql> select money_format(17014116);
  2. +------------------------+
  3. | money_format(17014116) |
  4. +------------------------+
  5. | 17,014,116.00 |
  6. +------------------------+
  7. mysql> select money_format(1123.456);
  8. +------------------------+
  9. | money_format(1123.456) |
  10. +------------------------+
  11. | 1,123.46 |
  12. +------------------------+
  13. mysql> select money_format(1123.4);
  14. +----------------------+
  15. | money_format(1123.4) |
  16. +----------------------+
  17. | 1,123.40 |
  18. +----------------------+

keyword MONEY_FORMAT,MONEY,FORMAT