Please enable JavaScript to view this site.

Codolex

The finance activity includes the financial activities delphi has to offer.

uses Business And Finance Routines

 

ChecksFinanace

Activity properties

 

Possible financial functions:

 

Double declining balance

Calculates the depreciation of an asset using the double-declining balance method.

 

Example:

Cost = 5000

Salvage = 1000

Life expectancy = 5

Period = 2

 

begin

var Finance: Double;

 Finance := DoubleDecliningBalance(Cost, Salvage, 5, 2);

end;

Result = 2400

 

Future investment value

Calculates the future value of an investment.

 

Example:

Present value = 1000

Payment = 100

Rate value = 0.05

Period = 5

Payment time = End of period

 

begin

var Finance: Double;

 Finance := FutureValue(RateValue, 5, Payment, PresentValue, ptEndOfPeriod);

end;

Result = -1828.84 (value is negative to symbolize what you could withdraw)

 

Interest rate

Returns the interest rate required to increase PresentValue to FutureValue.

 

Present value = 1000

Payment = 0

Future value = -10000 (needs to be negative to symbolize what you could withdraw)

Period = 10

Payment time = End of period

 

begin

var Finance: Double;

 Finance := InterestRate(RateValue, 5, Payment, PresentValue, ptEndOfPeriod);

end;

Result = 0.259...

 

Internal rate of return

Calculate the IRR of a cashflow with a guess in case of positive and negative cashflows.

 

CashFlow = [-1000,250,250,250,250,250,250] (First value is negative to symbolize the investment)

GuessValue = 0.2

 

begin

var Finance: Double;

Finance := InternalRateOfReturn(GuessValue, CashFlow);

end;

Result = 0.12978...

 

Loan interest

Calculate the portion of a loan payment that reflects the interest.

 

Present value = 1000

Future value = 500

Period = 3

number of periods = 5

Rate = 0.05

Payment time = End of period

 

begin

var Finance: Double;

 Finance :=  InterestPayment(Rate, 3, 5, PresentValue, FutureValue, ptEndOfPeriod);

end;

Result = -22.175...

 

Investment periods

Calculates the number of payment periods required for an investment of PresentValue to reach a value of FutureValue

 

Present value = 1000

Future value = -2000 (needs to be negative to symbolize what you could withdraw)

Payment = 50

Rate = 0.10

Payment time = End of period

 

begin

var Finance: Double;

Finance := NumberOfPeriods(Rate, Payment, PresentValue, FutureValue, ptStartOfPeriod);

end;

Result = 5.22335...

 

Fully amortized payment

Calculates the Payment needed for the amount of periods to get from present value to future value

 

Present value = 1000

Future value = -2000 (needs to be negative to symbolize what you could withdraw)

Periods = 5

Rate = 0.10

Payment time = End of period

 

begin

var Finance: Double;

Finance := NumberOfPeriods(Rate, 5, PresentValue, FutureValue, ptEndOfPeriod);

end;

Result = 63.79748...

 

Periodical payment

Calculates the principal amount from a full payment after a given period in a number of periods.

 

Present value = 0

Future value = -100 (needs to be negative to symbolize what you could withdraw)

Periods = 5

period =  3

Rate = 0.10

Payment time = End of period

 

begin

var Finance: Double;

Finance := PeriodPayment(Rate, 3, 5, PresentValue, FutureValue, ptEndOfPeriod);

end;

Result = 19.81949

 

Present investment value

Calculates the present value when the future value after an amount of periods is know.

 

Future value = -1000 (needs to be negative to symbolize what you could withdraw)

Periods = 3

Rate = 0.10

payment = 50

Payment time = ptStartOfPeriod

 

begin

var Finance: Double;

Finance := PresentValue(Rate, 3, PaymentValue, FutureValue, ptStartOfPeriod);

end;

Result = 614,53794

 

Net present investment value

Calculates the net present value for an investment, expected cashflows, and a rate

 

CashFlow = [-1000,400,400,400,400];

Rate =0.20

 

begin

var Finance: Double;

Finance := NetPresentValue(Rate, CashFlow, ptStartOfPeriod);

end;

Result = 35.49...

 

© by GDK Software