第一道题
解决方案 »
- 查询记录的统计函数如何取值
- ACCSS中怎样更新数据
- 函数int的功能是什么?为什么int(88200*0.06*100)结果是5291999 而不是5292000???
- 来一个帮我一下好不?
- 100分求救!!!关于text.text内容保存
- 急问:API函数Shell_NotifyIcon的使用问题!!!!!
- sanfen l
- 怎么样改变picture的图像大小?
- 求助,vb可否访问access2000?
- 一个你喜欢回答的问题,你们肯定能搞定,18位的数值显示问题
- VB6.0回调函数求助
- VB和单片机通讯的时候,单片机发送数据给VB,在VB上面的text显示出来的是{、?这些字符串,怎么样才可以把这些字符串变为数字显示出来啊
Private Function Get_Years(ByVal Amount As Double, ByVal Interrest As Double) As Long
Dim i As Long, n As Double
If Amount = 0 Or interrest = 0 Then Exit Function n = Amount
Do Until n >= 1000000
n = n * (1 + Interrest)
i = i + 1
Loop
Get_Years = i
End FunctionPrivate Sub Command1_Click()
Text3 = "In " & Get_Years(Val(Text1), Val(Text2)) & "years you will have a million."
End Sub
Private Sub Command1_Click()
Dim n As Double, m As Double
n = Val(Text1) - 40
m = Val(Text2)
Text3 = n
Text4 = Format(40 * m + n * m * 1.5, "standard")
End Sub
Private Function Get_Years2(ByVal Amount As Double, ByVal Interrest As Double) As Long
Dim y As Double
If Amount = 0 Or Interrest = 0 Then Exit Function
y = Log(1000000 / Amount) / Log(1 + Interrest)
Get_Years2 = RoundUp(y)
End FunctionFunction RoundUp(ByVal v As Double) As Double
RoundUp = Fix(v) + Sgn(v - Fix(v))
End Function