FUNCTION
deprecProRated
Return the depreciation for each accounting period. <span align="right" style="background-color:99FF99"><strong>Excel: AMORLINC</strong></span>
You're viewing an older version of this page (#327). View the current version.
Interface
#include <codecogs/finance/accounting/deprecprorated.h>
using namespace Finance::Accounting;
This function calculates the depreciation of an asset for each accounting period. It is provided for use with the French accounting system. This function is equivalent to the Microsoft Excel function AMORLINC.
Example 1
#include <stdio.h>
#include <codecogs/units/date/date.h>
#include <codecogs/finance/accounting/deprecprorated.h>
int main(void)
{
int datePur=Units::Date::date(1998, 8, 19);
int dateFir=Units::Date::date(1998, 12, 31);
double deprec;
deprec=Finance::Accounting::deprecProRated(2400,
datePur,
dateFir,
300,
1,
0.15,
Finance::Banking::yb_Act);
int y, m, d;
printf("Consider an asset with the following terms:\n\n");
printf("cost 2400, salvage 300, 1st period, rate 15%%\n");
Units::Date::dateYMD(datePur, y, m, d);
printf("purchase date %i/%i/%i, ", y, m, d);
Units::Date::dateYMD(dateFir, y, m, d);
printf("end of first period %i/%i/%i, ", y, m, d);
printf("depreciation=%f\n", deprec);
return 0;
}Output
Consider an asset with the following terms:
cost 2400, salvage 300, 1st period, rate 15%
purchase date 1998/8/19, end of first period 1998/12/31, depreciation=360.0Parameters
0.15).
Parameters
\copydoc YearBasis
Returns
In Excel, AMORLIC does not allow a YearBasis of yb_Act360. We can see few reasons for this restriction, so it is provided here. Otherwise this function should replicate Excel in every way.