Financial.PPmt メソッド
アセンブリ: Microsoft.VisualBasic (microsoft.visualbasic.dll 内)
構文
Public Shared Function PPmt ( _ 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.PPmt(Rate, Per, NPer, PV, FV, Due)
public static double PPmt ( double Rate, double Per, double NPer, double PV, [OptionalAttribute] double FV, [OptionalAttribute] DueDate Due )
public: static double PPmt ( double Rate, double Per, double NPer, double PV, [OptionalAttribute] double FV, [OptionalAttribute] DueDate Due )
public static double PPmt ( double Rate, double Per, double NPer, double PV, /** @attribute OptionalAttribute() */ double FV, /** @attribute OptionalAttribute() */ DueDate Due )
public static function PPmt ( Rate : double, Per : double, NPer : double, PV : double, FV : double, Due : DueDate ) : double
- Rate
必須。投資期間を通じて一定の利率を示す Double 型の値。たとえば、10% の年率 (APR) で自動車ローンを利用する際、毎月の支払いを指定した場合の月々の利率は 0.1/12 (0.0083) になります。
- NPer
必須。投資期間全体での支払い回数の合計を示す Double 型の値。たとえば、4 年間、月々分割払い自動車ローンを利用した場合、合計で 4 × 12 (= 48) の返済期間があることになります。
- PV
必須。将来行われる一連の支払いや受け取りを現時点で一括した場合の合計金額を示す Double 型の値。たとえば、自動車を購入するために資金を借り入れた場合、ローン金額は、毎月の返済の対象となる貸手にとっての現在価値を表します。
- FV
省略可能。投資の将来価値、つまり最後の支払いを行った後に残る現金の収支を示す Double 型の値。たとえば、ローンの将来価値は 0 です。最終支払い後の価値であるためです。ただし、子供の教育費のため、18 年間かけて 50 万円を貯金する場合、この 50 万円は将来価値になります。省略した場合、0 が使用されます。
- Due
省略可能。支払い期日を示すオブジェクト型 DueDate 列挙型 の値。各期の期末に支払う場合は DueDate.EndOfPeriod を、各期の期首に支払う場合は DueDate.BegOfPeriod をそれぞれ引数に指定します。省略した場合は、DueDate.EndOfPeriod を指定したものと見なされます。
定期的な定額の支払いおよび一定した利率に基づいて、指定された期間の元金の支払いを示す Double 型の値を返します。
詳細については、Visual Basic のトピック「PPmt 関数」を参照してください。
投資とは、一連の定額の支払いを一定の期間行うことです。たとえば、住宅ローンなどのローンまたは毎月の貯蓄プランなどの出資を指します。
Rate 引数と NPer 引数は、単位が同じ支払い期日を使用して計算する必要があります。たとえば、月を使用して Rate が計算される場合は、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" & vbNewLine 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) & vbNewLine Next Period ' Display amortization table. MsgBox(Msg) End If 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
- Financial.PPmt メソッドのページへのリンク