Financial 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
Financial
模块包含用于执行财务运算的过程。
public ref class Financial sealed
[Microsoft.VisualBasic.CompilerServices.StandardModule]
public sealed class Financial
[<Microsoft.VisualBasic.CompilerServices.StandardModule>]
type Financial = class
Public Module Financial
- 继承
-
Financial
- 属性
示例
此示例使用 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
注解
此模块支持执行折旧、当前和未来值、利率、收益率和付款等财务计算的 Visual Basic 运行时库成员。