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 到 NPer1 的付款期。

NPer
Double

必填。 年金中的付款期总数。 例如,如果你每月支付四年期汽车贷款,你的贷款总共有 4 x 12 (或 48) 付款期。

PV
Double

必填。 一系列未来付款或收据的当前值。 例如,当你借钱买车时,贷款金额是贷款人每月支付汽车付款的现值。

FV
Double

Optional. 完成最终付款后所需的未来价值或现金余额。 例如,贷款的未来值为 \$0,因为这是最终付款后的值。 但是,如果你想节省 \$50,000 超过 18 年的子女教育,那么 \$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 则还必须使用月份计算。

对于所有论点,支付的现金(如储蓄存款)由负数表示:收到的现金(如股息检查)以正数表示。

适用于

另请参阅