Financial 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
Financial
模組包含用來執行帳務處理運算的程序。
public ref class Financial sealed
[Microsoft.VisualBasic.CompilerServices.StandardModule]
public sealed class Financial
[<Microsoft.VisualBasic.CompilerServices.StandardModule>]
type Financial = class
Public Module Financial
- 繼承
-
Financial
- 屬性
範例
此範例會Rate
使用 函式來計算貸款的利率,假設 () 的付款總數、Payment
貸款付款金額 (TotPmts
) 、貸款 () 的現值或主體PVal
、貸款 FVal
() 的未來值、指出付款是否在付款期間PayType
開頭或結尾 () 和預期利率的Guess
近似值 () 。
Sub TestRate()
Dim PVal, Payment, TotPmts, APR As Double
Dim PayType As DueDate
' Define percentage format.
Dim Fmt As String = "##0.00"
Dim Response As MsgBoxResult
' Usually 0 for a loan.
Dim FVal As Double = 0
' Guess of 10 percent.
Dim Guess As Double = 0.1
PVal = CDbl(InputBox("How much did you borrow?"))
Payment = CDbl(InputBox("What's your monthly payment?"))
TotPmts = CDbl(InputBox("How many monthly payments do you have to make?"))
Response = MsgBox("Do you make payments at the end of the month?", MsgBoxStyle.YesNo)
If Response = MsgBoxResult.No Then
PayType = DueDate.BegOfPeriod
Else
PayType = DueDate.EndOfPeriod
End If
APR = (Rate(TotPmts, -Payment, PVal, FVal, PayType, Guess) * 12) * 100
MsgBox("Your interest rate is " & Format(CInt(APR), Fmt) & " percent.")
End Sub
備註
本課程模組支援 Visual Basic 運行時間連結庫成員,這些成員會執行財務計算,例如折舊、現值和未來值、利率、報酬率和付款。