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
函数计算贷款利率,给定 () 付款总数、贷款支付金额Payment
(TotPmts
) 、贷款 () 的现值或本金、贷款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运行时库成员,这些成员执行财务计算,例如折旧、现值和未来值、利率、回报率和付款。