Export (0) Print
Expand All

Financial Class

The Financial module contains procedures used to perform financial operations.

System.Object
  Microsoft.VisualBasic.Financial

Namespace:  Microsoft.VisualBasic
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

'Declaration
<StandardModuleAttribute> _
Public NotInheritable Class Financial

The Financial type exposes the following members.

  NameDescription
Public methodStatic memberDDBReturns a Double specifying the depreciation of an asset for a specific time period using the double-declining balance method or some other method you specify.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodStatic memberFVReturns a Double specifying the future value of an annuity based on periodic, fixed payments and a fixed interest rate.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberIPmtReturns a Double specifying the interest payment for a given period of an annuity based on periodic, fixed payments and a fixed interest rate.
Public methodStatic memberIRRReturns a Double specifying the internal rate of return for a series of periodic cash flows (payments and receipts).
Public methodStatic memberMIRRReturns a Double specifying the modified internal rate of return for a series of periodic cash flows (payments and receipts).
Public methodStatic memberNPerReturns a Double specifying the number of periods for an annuity based on periodic fixed payments and a fixed interest rate.
Public methodStatic memberNPVReturns a Double specifying the net present value of an investment based on a series of periodic cash flows (payments and receipts) and a discount rate.
Public methodStatic memberPmtReturns a Double specifying the payment for an annuity based on periodic, fixed payments and a fixed interest rate.
Public methodStatic memberPPmtReturns a Double specifying the principal payment for a given period of an annuity based on periodic fixed payments and a fixed interest rate.
Public methodStatic memberPVReturns a Double specifying the present value of an annuity based on periodic, fixed payments to be paid in the future and a fixed interest rate.
Public methodStatic memberRateReturns a Double specifying the interest rate per period for an annuity.
Public methodStatic memberSLNReturns a Double specifying the straight-line depreciation of an asset for a single period.
Public methodStatic memberSYDReturns a Double specifying the sum-of-years digits depreciation of an asset for a specified period.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

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.

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

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft