Financial Class

 

The Financial module contains procedures used to perform financial operations.

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

System.Object
  Microsoft.VisualBasic.Financial

<StandardModuleAttribute>
Public NotInheritable Class Financial

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticDDB(Double, Double, Double, Double, Double)

Returns 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.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticFV(Double, Double, Double, Double, DueDate)

Returns a Double specifying the future value of an annuity based on periodic, fixed payments and a fixed interest rate.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticIPmt(Double, Double, Double, Double, Double, DueDate)

Returns a Double specifying the interest payment for a given period of an annuity based on periodic, fixed payments and a fixed interest rate.

System_CAPS_pubmethodSystem_CAPS_staticIRR(Double(), Double)

Returns a Double specifying the internal rate of return for a series of periodic cash flows (payments and receipts).

System_CAPS_pubmethodSystem_CAPS_staticMIRR(Double(), Double, Double)

Returns a Double specifying the modified internal rate of return for a series of periodic cash flows (payments and receipts).

System_CAPS_pubmethodSystem_CAPS_staticNPer(Double, Double, Double, Double, DueDate)

Returns a Double specifying the number of periods for an annuity based on periodic fixed payments and a fixed interest rate.

System_CAPS_pubmethodSystem_CAPS_staticNPV(Double, Double())

Returns 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.

System_CAPS_pubmethodSystem_CAPS_staticPmt(Double, Double, Double, Double, DueDate)

Returns a Double specifying the payment for an annuity based on periodic, fixed payments and a fixed interest rate.

System_CAPS_pubmethodSystem_CAPS_staticPPmt(Double, Double, Double, Double, Double, DueDate)

Returns a Double specifying the principal payment for a given period of an annuity based on periodic fixed payments and a fixed interest rate.

System_CAPS_pubmethodSystem_CAPS_staticPV(Double, Double, Double, Double, DueDate)

Returns 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.

System_CAPS_pubmethodSystem_CAPS_staticRate(Double, Double, Double, Double, DueDate, Double)

Returns a Double specifying the interest rate per period for an annuity.

System_CAPS_pubmethodSystem_CAPS_staticSLN(Double, Double, Double)

Returns a Double specifying the straight-line depreciation of an asset for a single period.

System_CAPS_pubmethodSystem_CAPS_staticSYD(Double, Double, Double, Double)

Returns a Double specifying the sum-of-years digits depreciation of an asset for a specified period.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

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
Available since 1.1

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

Return to top
Show: