access数据库中的Round函数的使用方法:
(相关推荐:access数据库教程)
四舍五入的问题
select round(83.124,2) as t from jqdltb
显示为:83.12
select round(83.125,2) as t from jqdltb
显示为:83.12
select round(83.126,2) as t from jqdltb
显示为:83.13
问题来了,就是四舍五入怎么变成五舍六入了呢?
下面是用这个方法来调整达到四舍五入的方法:
使用int函数和加0.005,然后*100,再然后/100
如下所示:
select int((83.121+0.005)*100)/100 as t from jqdltb
显示为:83.12
select int((83.124+0.005)*100)/100 as t from jqdltb
显示为:83.12
select int((83.125+0.005)*100)/100 as t from jqdltb
显示为:83.13
select int((83.126+0.005)*100)/100 as t from jqdltb
显示为:83.13
select int((83.129+0.005)*100)/100 as t from jqdltb
显示为:83.13
以上就是access数据库中的Round函数怎么用的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号