Financial 類別
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
Financial
模組包含用來執行帳務處理運算的程序。
public ref class Financial sealed
C#
[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
近似值 () 。
VB
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 運行時間連結庫成員,這些成員會執行財務計算,例如折舊、現值和未來值、利率、報酬率和付款。
產品 | 版本 |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |