四舍五入.5 [英] rounding up on .5

查看:92
本文介绍了四舍五入.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Access 2003

我在报表卡db中使用以下表达式:

Final =(qt1 + qtr2 + qtr3 + qtr4)/ 4


该字段是一个数字字段设置为整数,小数位设置为0


大部分时间它正确舍入。但是,当答案为.5(例如98.5)时,它会向下舍入到98而不是99.


是否有一种相当简单的方法来解决这个问题,以便.5总是如此向上舍入?

Using Access 2003
I am using the following expression in a reportcard db:
Final=(qt1+qtr2+qtr3+qtr4)/4

The field is a Number Field set to integer and decimal places set to 0

Most of the time it rounds correctly. However, when the answer has .5 (such as 98.5) it rounds down to 98 instead of up to 99.

Is there a fairly easy way to fix this so that .5 always rounds up?

推荐答案



附件包含该函数以及如何在查询或表单中使用它,它会让你向上或向下舍入数字

希望这有助于

the attached file contains the function and how to use it within query or form, it will let you round the numbers up or down
hope this helps


@fnwtech


您可能需要某种''Hybrid''Round函数,试试这个:
@fnwtech
You may need some kind of ''Hybrid'' Round Function, try this:
展开 | 选择 | Wrap | 行号


@ADezii


ADezii - 你能告诉我我放在哪里吗?我把它放在这个声明中的某个地方吗?在End sub之后尝试,当然它忽略了它;)
@ADezii
ADezii - can you tell me where I place this? Do I place it somewhere within this statement? Tried after the End sub and of course it ignores it ;)
展开 | 选择 | Wrap | 行号


这篇关于四舍五入.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆