关于使用金融.ddb 功能的任何建议?我需要仅使用 Financial.ddb 函数在标签中显示折旧计划。我能够在期末显示最终折旧值,但我不知道如何显示该期间每一年的价值。
例如,如果用户输入了 1,000 英镑的资产成本、4 年的使用寿命和 100 美元的残值,则应显示:
第 1 年:500.00
第二年:250.00
第三年:125.00
第 4 年:25.00
但是,我的代码(如下)显示每年 25.00。
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 处理 Button1.Click
Dim cost As Double
Dim life As Double = CDbl(ComboBox1.SelectedItem)
Dim salvage As Double
Dim numberperiod As Integer
Dim period As Integer
Dim depreciation As Double
Dim isconverted1 As Boolean
Dim isconverted2 As Boolean
Dim isconverted3 As Boolean
isconverted1 = Double.TryParse(TextBox1.Text, cost)
isconverted2 = Double.TryParse(TextBox2.Text, salvage)
isconverted3 = Integer.TryParse(TextBox3.Text, period)
For numberperiod = 1 To period Step 1
depreciation = Financial.DDB(cost, salvage, life, period)
Label1.Text += numberperiod.ToString & " -> " & Convert.ToString(depreciation) _
& ControlChars.NewLine
Next numberperiod
End Sub
非常感谢你看这个。