Visual FoxPro General
Like what
VFP already has some financial functions built-in (e.g. NPV(), PV() and FV() to name but three)
You can easily create your own functions to do anything you want - or are you looking for the formulae
We need some more information here....
Im looking for function IPMT().
Currently I used IPMT() of Excel, but I think it is better that you have a native function.
Thanks
VFP has the following:
PAYMENT()
Returns the amount of each periodic payment on a fixed-interest loan.
PAYMENT(nPrincipal, nInterestRate, nPayments)
PV()
Returns the present value of an investment.
PV(nPayment, nInterestRate, nTotalPayments)
FV()
Returns the future value of a financial investment.
FV(nPayment, nInterestRate, nPeriods)
In addition there is the NPV() option for the CALCULATE command which operates on multiple records and computes the net present value of a series of future cash flows discounted at a constant periodic interest rate.
NPV(nExpression1, nExpression2 [, nExpression3])
Other than these, you are on your own - either write your own function or, as Alex suggests, call the Excel function using Automation
Anyway thanks everyone for immediate response.
I got the IPMT formula from microsoft and I will try to translate it into VFP code.