Financial.PPmt(Double, Double, Double, Double, Double, DueDate) 方法

定義

傳回值,指定根據定期、定額付款及固定利率所計算的年金在給定之期間內的本金付款款項。

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 x 12 (即 48) 期。

PV
Double

必要。 一系列未來付款或收款的現值。 例如,當您貸款買車時,貸款金額就是您要以每月支付方式付給貸方的車款金額現值。

FV
Double

選擇性。 您在最後一次付款之後想要的未來價值或現金餘額。 例如,貸款的未來值為 $0,因為是代表最後一期付款之後的值。 然而,如果您想在 18 年內存下美金 $50,000 元做為子女教育費用,那麼美金 $50,000 元就是未來值。 如果省略,則假設為 0。

Due
DueDate

選擇性。 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

備註

年金是一系列在一段時間內進行的固定現金付款。 年金可以是貸款 (,例如家庭) 或投資 (,例如每月節省方案) 。

RateNPer 自變數必須使用以相同單位表示的付款期間來計算。 例如,如果使用 Rate 月份計算, NPer 也必須使用月份來計算。

對於所有自變數,支付的現金 (例如儲存) 的現金會以負數表示;收到現金 (,例如正數表示) 的除數檢查。

適用於

另請參閱