Talk:Documentation/Calc Functions/DB

    From The Document Foundation Wiki

    SF comments

    (1) General. I do not see how this function makes sense if Life and Period are not defined in years. My comments and suggestions below assume this to be the case. This assumption also matches the description of these parameters at https://wiki.openoffice.org/wiki/Documentation/How_Tos/Calc:_DB_function.
    (2) Summary. Suggest replacing with “Calculates the depreciation of an asset for a given period using the fixed rate declining-balance method. This method calculates the depreciation based on the current book value of the asset (rather than its original cost) and this decreases from one period to the next. This leads to the depreciation being greater in earlier periods and less in later periods.”.
    (3) Returns. Change “positive” to “non-negative” (function can return 0). Insert space before the open bracket. “Currency” does not require an uppercase letter. Change “fixed-declining balance” to “fixed rate declining-balance”. Do we need to say that the currency unit for the return value is that used for the Cost and Salvage values?
    (4) Arguments, Cost and Salvage. Is it worth saying that these values should be in the same currency unit?
    (5) Arguments, Life. Suggest changing “period” to “number of years”.
    (6) Arguments, Period. Suggest changing to - “Period is a non-negative integer or a reference to the cell containing that number which represents the year for which the depreciation is to be calculated.”.
    (7) Arguments, Month. Suggest changing “positive number from 1 to 12” to “integer in the range 1 to 12”.
    (8) Arguments, general. Inspecting the code, I have discovered that entering a Life > 1200 will cause an error. Also entering a Salvage value that is greater than the Cost value will cause an error.
    (9) Additional details. I think that there is too much detail in this section (even though it may be correct and obtained from the ODF). Suggest reducing it to match the material provided below the argument list given on the https://wiki.openoffice.org/wiki/Documentation/How_Tos/Calc:_DB_function page (but modified to use our argument names).
    (10) Examples, 1st example. Please update description to reflect correct units of Life and Period.

    --Stevefanning (talk) 2020-11-15T10:53:10 (UTC)

    Laura comments

    (1) General: it seems that the function could be used also when Life and Period are not defined in years, as long as they are in the same units? As the description in ODF Standard. If a value for Month is specified then Life and Period are assumed to be in years. Is this how the function works?
    (2) I think the Summary suggested by Steve is more clear.

    Laura update

    After inspecting the code, I agree with Steve that Life and Period should be defined in years. I updated the page accordingly, and addressed also the other comments.