共用方式為


Financial.NPer 方法

傳回 Double,指定根據定期、定額款項及固定利率所計算的年金期數。

命名空間: Microsoft.VisualBasic
組件: Microsoft.VisualBasic (在 microsoft.visualbasic.dll 中)

語法

'宣告
Public Shared Function NPer ( _
    Rate As Double, _
    Pmt As Double, _
    PV As Double, _
    <OptionalAttribute> Optional FV As Double = 0, _
    <OptionalAttribute> Optional Due As DueDate = DueDate.EndOfPeriod _
) As Double
'用途
Dim Rate As Double
Dim Pmt As Double
Dim PV As Double
Dim FV As Double
Dim Due As DueDate
Dim returnValue As Double

returnValue = Financial.NPer(Rate, Pmt, PV, FV, Due)
public static double NPer (
    double Rate,
    double Pmt,
    double PV,
    [OptionalAttribute] double FV,
    [OptionalAttribute] DueDate Due
)
public:
static double NPer (
    double Rate, 
    double Pmt, 
    double PV, 
    [OptionalAttribute] double FV, 
    [OptionalAttribute] DueDate Due
)
public static double NPer (
    double Rate, 
    double Pmt, 
    double PV, 
    /** @attribute OptionalAttribute() */ double FV, 
    /** @attribute OptionalAttribute() */ DueDate Due
)
public static function NPer (
    Rate : double, 
    Pmt : double, 
    PV : double, 
    FV : double, 
    Due : DueDate
) : double

參數

  • Rate
    必要項。Double,指定每期利率。例如,如果您的汽車貸款年利率 (APR) 為 10% 並採月付方式償還,則每期的利率為 0.1/12,也就是 0.0083。
  • Pmt
    必要項。Double,指定每一期所要付的款項。款項通常包含本金,以及不會隨著年金的有效期間而變更的利息。
  • PV
    必要項。Double,指定一系列的未來付款或收到款項的現值或今天的價值。例如,當您貸款買車時,貸款金額就是您要以每月支付方式付給貸方的車款金額現值。
  • FV
    選擇項。Double,指定您在最後一次付款之後想要的未來值或現金結存。例如,貸款的未來值為 $0,因為是代表最後一期付款之後的值。然而,如果您想在 18 年內存下美金 $50,000 元做為子女教育費用,那麼美金 $50,000 元就是未來值。如果省略,則假設為 0。
  • Due
    選擇項。DueDate 列舉型別 型別的物件,指定付款何時到期。這個引數必須是 DueDate.EndOfPeriod (若付款期限是付款期間的結束日),或 DueDate.BegOfPeriod (若付款期限是付款期間的開始日)。如果省略,則假設為 DueDate.EndOfPeriod

傳回值

傳回 Double,指定根據定期、定額款項及固定利率所計算的年金期數。

備註

如需詳細資訊,請參閱 Visual Basic 的主題 NPer 函式

年金是在約定期間內一連串的固定現金付款。年金可以是借貸 (例如房屋抵押貸款),也可以是投資 (例如每月定存存單)。

凡是引數,現金支出 (例如存款) 都以負數來表示,現金收入 (例如股息支票) 則以正數來表示。

範例

此範例使用 NPer 函式,傳回貸款的款項必須付清的期數 (貸款的值包含在 PVal 內)。此外,也會提供每期的百分比利率 (APR / 12)、付款 (Payment)、貸款的未來值 (FVal) 以及指出付款是在付款期間的開頭或結尾到期的數字 (PayType)。

Sub TestNPer()
    Dim TotPmts As Double
    Dim PVal, APR, Payment As Double
    Dim PayType As DueDate
    Dim Response As MsgBoxResult

    ' 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?"))
    ' Usually 0 for a loan.
    If APR > 1 Then APR = APR / 100
    Payment = CDbl(InputBox("How much do you want to pay each month?"))
    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
    TotPmts = NPer(APR / 12, -Payment, PVal, FVal, PayType)
    If Int(TotPmts) <> TotPmts Then TotPmts = Int(TotPmts) + 1

    MsgBox("It will take you " & TotPmts & " months to pay off your loan.")
End Sub

平台

Windows 98、 Windows 2000 SP4、 Windows CE、 Windows Millennium Edition、 Windows Mobile for Pocket PC、 Windows Mobile for Smartphone、 Windows Server 2003、 Windows XP Media Center Edition、 Windows XP Professional x64 Edition、 Windows XP SP2、 Windows XP Starter Edition

.NET Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱系統需求一節的內容。

版本資訊

.NET Framework

支援版本:2.0、1.1、1.0

.NET Compact Framework

支援版本:2.0、1.0

請參閱

參考

Financial 類別
Financial 成員
Microsoft.VisualBasic 命名空間
ArgumentException

其他資源

NPer 函式
財務摘要