傳回 Double,指定根據定期、定額款項及固定利率所計算的年金在給定之期間內的利息付款。
命名空間: Microsoft.VisualBasic
組件: Microsoft.VisualBasic (在 microsoft.visualbasic.dll 中)
語法
'宣告
Public Shared Function IPmt ( _
Rate As Double, _
Per As Double, _
NPer 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 Per As Double
Dim NPer As Double
Dim PV As Double
Dim FV As Double
Dim Due As DueDate
Dim returnValue As Double
returnValue = Financial.IPmt(Rate, Per, NPer, PV, FV, Due)
public static double IPmt (
double Rate,
double Per,
double NPer,
double PV,
[OptionalAttribute] double FV,
[OptionalAttribute] DueDate Due
)
public:
static double IPmt (
double Rate,
double Per,
double NPer,
double PV,
[OptionalAttribute] double FV,
[OptionalAttribute] DueDate Due
)
public static double IPmt (
double Rate,
double Per,
double NPer,
double PV,
/** @attribute OptionalAttribute() */ double FV,
/** @attribute OptionalAttribute() */ DueDate Due
)
public static function IPmt (
Rate : double,
Per : double,
NPer : double,
PV : double,
FV : double,
Due : DueDate
) : 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.EndOfPeriod(若付款期限是付款期間的結束日),或DueDate.BegOfPeriod(若付款期限是付款期間的開始日)。如果省略,則假設為DueDate.EndOfPeriod。
傳回值
傳回 Double,指定根據定期、定額款項及固定利率所計算的年金在給定之期間內的利息付款。
備註
如需詳細資訊,請參閱 Visual Basic 的主題 IPmt 函式。
年金是在約定期間內一系列的固定現金付款。年金可以是借貸 (例如房屋抵押貸款),也可以是投資 (例如每月定存存單)。
Rate 和 NPer 引數必須使用以相同單位表示的付款週期計算。例如,如果 Rate 是以月計算,則 NPer 也必須以月來計算。
凡是引數,現金支出 (例如存款) 都以負數來表示,現金收入 (例如股息支票) 則以正數來表示。
範例
此範例使用 IPmt 函式計算當所有付款的價值都相同時,付款中有多少是利息部分。給定的項目包括每一期的百分比利率 (APR / 12)、在希望支付的利息部分下所需的付款期間 (Period)、付款總期數 (TotPmts)、貸款的現值或本金 (PVal)、貸款的未來值 (FVal) 以及指出付款要在付款期間的開頭或結尾到期的數字 (PayType)。
Sub TestIPMT()
Dim APR, PVal, Period, IntPmt, TotInt, TotPmts As Double
Dim PayType As DueDate
Dim Response As MsgBoxResult
' Usually 0 for a loan.
Dim Fval As Double = 0
' Define money format.
Dim Fmt As String = "###,###,##0.00"
PVal = CDbl(InputBox("How much do you want to borrow?"))
APR = CDbl(InputBox("What is the annual percentage rate of your loan?"))
If APR > 1 Then APR = APR / 100 ' Ensure proper form.
TotPmts = CInt(InputBox("How many monthly payments?"))
Response = MsgBox("Do you make payments at end of the month?", MsgBoxStyle.YesNo)
If Response = MsgBoxResult.No Then
PayType = DueDate.BegOfPeriod
Else
PayType = DueDate.EndOfPeriod
End If
For Period = 1 To TotPmts ' Total all interest.
IntPmt = IPmt(APR / 12, Period, TotPmts, -PVal, Fval, PayType)
TotInt = TotInt + IntPmt
Next Period
' Display results.
MsgBox("You will pay a total of " & Format(TotInt, Fmt) & _
" in interest for this 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