Financial.PPmt(Double, Double, Double, Double, Double, DueDate) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
回傳一個基於定期固定還款和固定利率,指定特定期間年金本金還款金額的價值。
public static double PPmt(double Rate, double Per, double NPer, double PV, double FV = 0, Microsoft.VisualBasic.DueDate Due = Microsoft.VisualBasic.DueDate.EndOfPeriod);
static member PPmt : double * double * double * double * double * Microsoft.VisualBasic.DueDate -> double
Public Function PPmt (Rate As Double, Per As Double, NPer As Double, PV As Double, Optional FV As Double = 0, Optional Due As DueDate = Microsoft.VisualBasic.DueDate.EndOfPeriod) As Double
參數
- Rate
- Double
必須的。 每個週期的利率。 例如,如果您的汽車貸款的年利率 (APR) 是10%,並且每月付款,則每期的利率為 0.1/12 或 0.0083。
- Per
- Double
必須的。 付款期間範圍為1至 NPer。
- NPer
- Double
必須的。 年金的總付款期間數。 例如,如果你每月還款四年車貸,你的貸款總共有4個12分(或48個)還款期。
- PV
- Double
必須的。 一系列未來付款或收款的現值。 例如,當你借錢買車時,貸款金額就是你每月汽車還款的現值。
- FV
- Double
Optional. 你在支付最後一筆款項後想要的未來價值或現金餘額。 例如,貸款的未來價值為 \$0,因為這是最終還款後的價值。 然而,如果你想在18年內為孩子存下50,000美元,那麼50,000美元就是未來的價值。 如果沒有指定,會假設為 0。
- Due
- DueDate
Optional. 指定付款到期時間的物件 DueDate 。 這個論點必須是 DueDate.EndOfPeriod 付款是在付款期間結束時到期,或 DueDate.BegOfPeriod 是付款在該期間開始時到期。 若省略, DueDate.EndOfPeriod 則視為假定。
傳回
基於定期固定付款和固定利率,年金在特定期間內的本金還款額。
例外狀況
Per
<=0 或 Per>NPer。
範例
此範例使用函 PPmt 數計算當所有付款金額相等時,特定期間的還款金額中有多少屬於本金。 例如:) (APR / 12 期間的利率百分比、) (Period 希望還款的還款期間、) (TotPmts 的總還款次數、貸款 (PVal) 的現值或本金、貸款 (FVal) 的未來價值,以及表示還款是在還款期開始或結束) (PayType 的數字。
Sub TestPPMT()
Dim PVal, APR, TotPmts, Payment, Period, P, I As Double
Dim PayType As DueDate
Dim Msg As String
Dim Response As MsgBoxResult
' Define money format.
Dim Fmt As String = "###,###,##0.00"
' Usually 0 for a loan.
Dim Fval As Double = 0
PVal = CDbl(InputBox("How much do you want to borrow?"))
APR = CDbl(InputBox("What is the annual percentage rate of your loan?"))
' Ensure proper form.
If APR > 1 Then APR = APR / 100
TotPmts = CDbl(InputBox("How many monthly payments do you have to make?"))
Response = MsgBox("Do you make payments at the end of month?", MsgBoxStyle.YesNo)
If Response = MsgBoxResult.No Then
PayType = DueDate.BegOfPeriod
Else
PayType = DueDate.EndOfPeriod
End If
Payment = Math.Abs(-Pmt(APR / 12, TotPmts, PVal, FVal, PayType))
Msg = "Your monthly payment is " & Format(Payment, Fmt) & ". "
Msg = Msg & "Would you like a breakdown of your principal and "
Msg = Msg & "interest per period?"
' See if chart is desired.
Response = MsgBox(Msg, MsgBoxStyle.YesNo)
If Response <> MsgBoxResult.No Then
If TotPmts > 12 Then MsgBox("Only first year will be shown.")
Msg = "Month Payment Principal Interest" & Environment.NewLine
For Period = 1 To TotPmts
' Show only first 12.
If Period > 12 Then Exit For
P = PPmt(APR / 12, Period, TotPmts, -PVal, FVal, PayType)
' Round principal.
P = (Int((P + 0.005) * 100) / 100)
I = Payment - P
' Round interest.
I = (Int((I + 0.005) * 100) / 100)
Msg = Msg & Period & vbTab & Format(Payment, Fmt)
Msg = Msg & vbTab & Format(P, Fmt) & vbTab & Format(I, Fmt) & Environment.NewLine
Next Period
' Display amortization table.
MsgBox(Msg)
End If
End Sub
備註
年金是指一段時間內,一系列的固定現金付款活動。 年金可能是一筆貸款 (例如房屋貸款) 或投資 (例如每月存款計劃)。
Rate和 NPer 參數必須以相同單位表示的付款期間計算。 例如,若 Rate 是用月份計算,則 NPer 也必須用月份計算。
對於所有論點,已支付的現金(例如存款到儲蓄)都以負數表示;收到的現金(如股息支票)以正數表示。