大家帮忙看看VB中计算问题
大家帮忙看下,在VB中有个变量str=0.00016如何计算让它变成是1.6*10的4次方
还有个问题是关于数据库查询的
在ACCESS中如何查询时,判断字段1是否为空如果是则查询字段2
在SQL中应该是select case 字段1 isnul then 字段2 end from 表名
大家看看在ACCESS中是查询的,解决了再加分
str = cdbl(str) * 100000000#
VB code:
Option Explicit
Private Sub Form_Load()
Dim strP As String
strP = "0.00016"
strP = Val(strP) * 100000000
Text1.Text = strP
End Sub
第一个问题本是1.6×10的-4次方,你要变10的4次,就将其×10的8次方(问题有点过于简单?)
[access] select iif(isnull(字段1),字段2,字段1) from 表名
刚才说错了,应该是1.6*10负4次方,我按照你们的方法怎么结果是160000
VB code:
str = Format$(0.00016,"#.#E+")
VB code:
Dim istr As String
istr = Format(0.00016, "0.##E+")
str = Format$(0.00016,"#.#E+")
VB code:
Private Sub Form_Load()
s = Format(0.00016, "0.0E+")
MsgBox
相关问答:
大家好,问个vb打印问题
printer.print "dsff"
.....
....
Printer.EndDoc
打印成功后我将执行
sqlstr = "update vc_yh set pr=' 已打印 ', ......
1.用Shell "regsvr32 " & App.Path & "\abcdefghijklmnopqrstuvwxyz.ocx"注册控件,怎么不显示注册成功对话框?
2.修改d:\12345.txt属性->只读,非只读,隐藏,非隐藏
3 ......
function multi(a as integer,b as integer,optional third)
dim n as integer
n = a * b
if not ismissing (third) then
n = n * thid
end if
multi = n
end fu ......
Private Sub Command1_Click()
Dim m As Integer '接受文本框一的数值
Dim n As Integer '接受文本框二的数值
Dim k As Integ ......
VB语句像英语,C++语句像数学,我数学比英语好……
有些VB语句干脆就是英语句子,虽然很容易懂,但我不是老外,对英语没有任何亲切感,也就不感觉VB更容易,相反C++语句逻辑性更强,像数学题似的,看的反而流 ......