首页 > 其他 > 详细

round(x,y)和format(x,y)

时间:2018-07-04 15:30:08      阅读:242      评论:0      收藏:0      [点我收藏+]
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()返回的仍然是数值

round(x,y)和format(x,y)

原文:https://www.cnblogs.com/bibiafa/p/9263483.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!