MKoD - D Programming Language

A Financial Package for D

Financial Package in the Red-Orbs font
Well, I've decided to go ahead and take a dive forward with this idea of a D Financial Package that's to be compatible with MS Excel's VBA (and VB6's) financial functions. It should help make D more attractive to those who wish to create business-type applications. Plus if I get stuck...I can always ask for some help from others on the D user's forum ( at least that's the plan so far :)) ).


"D Financial Functions" (VB6 / Excel VBA Compatible) - financial.d

  • db( rCost, rSalvage, rLife, rPeriod, uiMonth = 12 ) - 100% Done, passed test.
    Calculates the depreciation of an assest for a period using the fixed-declining balance method.

  • ddb( rCost, rSalvage, rLife, rPeriod, rFactor = 2.0 ) - 100% Done, passed test.
    Calculates the deperciation of an asset for a period using the double-declining balance method.

  • fv( rRate, rNPer, rPmt, rPV = 0.0, uiType = 0 ) - 100% Done, passed test.
    Calculates the future value of an investment based on periodic, constant payments and a constant interest rate.

  • ipmt( rRate, rPer, rNPer, rPV, rFV = 0.0, uiType = 0 ) - 100% Done, passed test.
    Calculates the interest payment during a specific period of an investment.

  • irr( rValues(), rGuess = 0.1 ) - 100% Done, passed test.
    Calculates the internal rate of return for a series of cash flows represented by the numbers of values.

  • ispmt( rRate, rPer, rNPer, rPV ) - 100% Done, passed test.
    Calculates the interest paid during a specific period of an investment.

  • mirr( rValues(), rFinance_Rate, rReinvest_Rate ) - 100% Done, passed test.
    Calculates the modified intermal rate of return for a series of periodic cash flows.

  • nper( rRate, rPmt, rPV, rFV = 0.0, uiType = 0 ) - 100% Done, passed test.
    Returns the number of periods for an investment based on periodic, constant payments and a constant interest rate.

  • npv( rRate, rValue1, rValue2, ... ) - 100% Done, passed test.
    Calculates the net present value (rPV) of an investment by using a discount rate and a series of future payments (negative values) and income (positive values).

  • pmt( rRate, rNPer, rPV, rFV = 0.0, uiType = 0 ) - 100% Done, passed test.
    Calculates the payment for a loan based on constant payments and a constant interest rate.

  • ppmt( rRate, rNPer, rPV, rFV = 0.0, uiType = 0 ) - 100% Done, passed test.
    Calculates the payment on the principal for a given period for an investment based on periodic, constant payments and a constant interest rate.

  • pv( rRate, rNPer, rPV, rFV = 0.0, uiType = 0 ) - 100% Done, passed test.
    Calculates the present value of an investment.

  • rate( rNPer, rPmt, rPV, rFV = 0.0, uiType = 0, rGuess = 0.1 ) - 100% Done, passed test.
    Calculates the interest rate per period of an annuity.

  • sln( rCost, rSalvage, rLife ) - 100% Done, passed test.
    Calculates the straight-line depreciation of an asset for one period.

  • syd( rCost, rSalvage, rLife, rPer ) - 100% Done, passed test.
    Calculates the sum-ofyears' digits depreciation of an asset for a specified period.

  • vdb( rCost, rSalvage, rLife, rStart_Period, rEnd_Period, rFactor = 2.0, bNo_Switch = false ) - 100% Done, passed test.
    Calculates the variable declining balance (depreciation) of an asset.

  • xnpv( rRate, rPayments(), dtDates() ) - 100% Done, passed test.
  • xnpv( rRate, rPayments(), sDates() ) - 100% Done, passed test.
    Calculates the Net Present Value of an investment for a series of cash flow.

  • xirr( rPayments(), dtDates(), rGuess = 0.1 ) - 100% Done, passed test.
  • xirr( rPayments(), sDates(), rGuess = 0.1 ) - 100% Done, passed test.
    Calculates the Interest Rate for a series of cash flow.

  • effect( rNominalRate, rNumPerYr ) - 100% Done, passed test.
    Calculates the effective annual interest rate.

  • nominal( rEffectRate, rNumPerYr ) - 100% Done, passed test.
    Calculates the nominal annual interest rate.

  • dollarde( rFractionalDollar, uiFraction ) - 100% Done, passed test.
    Calculates dollar price expressed as a decimal number.

  • dollarfr( rDecimalDollar, uiFraction ) - 100% Done, passed test.
    Calculates dollar price expressed as a fraction.

  • D Financial Package v1.0 (12Kb updated 18.Jul.08 - D v1.033)
  • Discover Mars Magik