select round(123456.1456,2); +----------------------+ | round(123456.1456,2) | +----------------------+ | 123456.15 | +----------------------+ select format(123456.1456,2); +-----------------------+ | format(123456.1456,2) | +-----------------------+ | 123,456.15 | +-----------------------+
round()和format()都会对数值进行四舍五入,但是format()返回的是字符串,整数部分,每3位添加一个逗号。round()返回的仍然是数值