共用方式為


Financial 類別

Financial 模組包含用來執行帳務處理運算的程序。

命名空間: Microsoft.VisualBasic
組件: Microsoft.VisualBasic (在 microsoft.visualbasic.dll 中)

語法

'宣告
Public NotInheritable Class Financial
'用途
Dim instance As Financial
public sealed class Financial
public ref class Financial sealed
public final class Financial
public final class Financial

備註

如需詳細資訊,請參閱 Visual Basic 的主題 Financial 模組 (Visual Basic)

這個模組可支援 Visual Basic 執行階段程式庫成員,這些成員可執行一些帳務計算,例如折舊值、現值和未來值、利率、報酬率和付款等。

範例

此範例使用 Rate 函式來計算貸款的利率,而條件是有提供付款總期數 (TotPmts)、貸款金額 (Payment)、貸款的現值或本金 (PVal)、貸款的未來值 (FVal)、指出付款要在付款期間的開頭或結尾到期的數字 (PayType),以及預期利率的大約值 (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

繼承階層架構

System.Object
  Microsoft.VisualBasic.Financial

執行緒安全

這個型別的所有公用靜態成員 (即 Visual Basic 中的 Shared 成員) 都是安全執行緒。並非所有的執行個體成員均為安全執行緒。

平台

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 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱系統需求一節的內容。

版本資訊

.NET Framework

支援版本:2.0、1.1、1.0

.NET Compact Framework

支援版本:2.0、1.0

請參閱

參考

Financial 成員
Microsoft.VisualBasic 命名空間

其他資源

Financial 模組 (Visual Basic)
財務摘要
關鍵字和成員 (依工作分類)
Visual Basic 語言關鍵字
Visual Basic 執行階段程式庫成員
比較不同語言的關鍵字