Financial Třída

Definice

Modul `Financial` obsahuje postupy, které slouží k provádění finančních operací.The `Financial` module contains procedures used to perform financial operations.

``public ref class Financial sealed``
``````[Microsoft.VisualBasic.CompilerServices.StandardModule]
public sealed class Financial``````
``type Financial = class``
``Public Module Financial``
Dědičnost
Financial
Atributy

V tomto příkladu se pomocí funkce `Rate` vypočítá úroková sazba půjčky, v případě celkového počtu plateb (`TotPmts`), částky platby za půjčku (`Payment`), aktuální hodnoty nebo jistiny půjčky (`PVal`), budoucí hodnoty půjčky (`FVal`), číslo, které označuje, zda je platba splatná na začátku nebo na konci platebního období (`PayType`) a odhad očekávané úrokové sazby (`Guess`).This example uses the `Rate` function to calculate the interest rate of a loan, given the total number of payments (`TotPmts`), the amount of the loan payment (`Payment`), the present value or principal of the loan (`PVal`), the future value of the loan (`FVal`), a number that indicates whether the payment is due at the beginning or end of the payment period (`PayType`), and an approximation of the expected interest rate (`Guess`).

``````Sub TestRate()
Dim PVal, Payment, TotPmts, APR As Double
Dim PayType As DueDate

' Define percentage format.
Dim Fmt As String = "##0.00"
Dim Response As MsgBoxResult
' Usually 0 for a loan.
Dim FVal As Double = 0
' Guess of 10 percent.
Dim Guess As Double = 0.1
PVal = CDbl(InputBox("How much did you borrow?"))
Payment = CDbl(InputBox("What's your monthly payment?"))
TotPmts = CDbl(InputBox("How many monthly payments do you have to make?"))
Response = MsgBox("Do you make payments at the end of the month?", MsgBoxStyle.YesNo)
If Response = MsgBoxResult.No Then
PayType = DueDate.BegOfPeriod
Else
PayType = DueDate.EndOfPeriod
End If
APR = (Rate(TotPmts, -Payment, PVal, FVal, PayType, Guess) * 12) * 100

MsgBox("Your interest rate is " & Format(CInt(APR), Fmt) & " percent.")
End Sub
``````

Poznámky

Tento modul podporuje Visual Basic členy knihovny runtime, které provádějí finanční výpočty, jako jsou odpisy, současná a budoucí hodnoty, úrokové sazby, počty návratnosti a platby.This module supports the Visual Basic run-time library members that perform financial calculations such as depreciation, present and future values, interest rates, rates of return, and payments.