# Financial Class

**Visual Studio 2010**

The Financial module contains procedures used to perform financial operations.

**Namespace:**Microsoft.VisualBasic

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

The Financial type exposes the following members.

Name | Description | |
---|---|---|

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

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

Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |

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

GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |

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

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

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

MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |

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

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

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

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

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

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

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

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

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

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

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

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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