如何舍入访问表单中的文本框值 [英] How to round a text box value in the access form

查看:88
本文介绍了如何舍入访问表单中的文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我有一个值为1.64999997615814的文本框。我怎样才能将其四舍五入到1.7?


这可以使用文本框控件属性吗?。

For example, i have a text box with value 1.64999997615814. How can i round it off to 1.7 ?.

Is this possible using the text box control properties ?.

推荐答案


例如,我有一个值为1.64999997615814的文本框。我怎样才能将其四舍五入到1.7?


这可以使用文本框控件属性吗?
For example, i have a text box with value 1.64999997615814. How can i round it off to 1.7 ?.

Is this possible using the text box control properties ?.



我实际上使用查询设计视图为字段生成上述值。是否可以使用查询设计中的Round()函数来舍入上述数字。

I actually use the query design view to generate the above value for a field. Is it possible to round off the above number using the Round() function in the query design.


您可以将文本框的控制源设置为以下内容:

= Round([decimalField],1)


其中" decimalField"是要舍入的字段的名称。

1表示舍入的精度。
You can set the control source of the textbox to the following:

=Round([decimalField],1)

Where "decimalField" is name of the field you want to Round.
The 1 represents the precision of rounding.



You可以将文本框的控制源设置为以下内容:

= Round([decimalField],1)


其中& ; decimalField"是要舍入的字段的名称。

1表示舍入的精度。
You can set the control source of the textbox to the following:

=Round([decimalField],1)

Where "decimalField" is name of the field you want to Round.
The 1 represents the precision of rounding.



AI_grade :( [AI_1_grade] * 3 + [AI_2_grade] + [AI_3_grade] * 2)/ 6


以上为字段AI_grade提供值1.64999997615814。现在我需要在完成后将AI_grade的值设为1.7。如何在同一个查询中执行此操作?

AI_grade: ([AI_1_grade]*3+[AI_2_grade]+[AI_3_grade]*2)/6

the above gives the value 1.64999997615814 for field AI_grade. Now i need the value of AI_grade to be 1.7 after round off. How to do it in the same query?.


这篇关于如何舍入访问表单中的文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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