Financial 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
包含執行財務操作的程序。
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 數計算貸款利率,給定總還款次數(TotPmts)、貸款還款金額(Payment)、貸款現值或本金(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 執行時函式庫成員,執行折舊、現值與未來價值、利率、報酬率及付款等財務計算。