标题:text控件显示数字的问题!
只看楼主
wjt_1221
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-9-19
 问题点数:0 回复次数:1 
text控件显示数字的问题!

Private Sub Command1_Click()
Dim a As Double
Dim b As Double
Dim c As Double
Dim a1 As Double
Dim b1 As Double
Dim c1 As Double
a = Val(Text1.Text)
b = Val(Text2.Text)
c = a - b

a1 = Val(Text4.Text)
b1 = Val(Text5.Text)
c1 = a1 - b1

x = (c + c1) / 2

Text7.Text = Str(Round(x, 4))
End Sub

例如:
a=69.2875 b=69.2782
a1=69.2875 b1=69.2777
显出的是0.0095 四舍六入应该是0.0096
请问高手怎么处理??

2007-10-14 21:41
yuziyi
Rank: 1
等 级:新手上路
帖 子:35
专家分:0
注 册:2007-10-12
得分:0 
  是 VB 呀    我这几天正在努力学呢 哈哈

2007-10-14 23:18



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-177638-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.508824 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved