• Resolved klingbeil

    (@klingbeil)


    Hello;
    Where is the error in a script? Actually, my every step is correct.
    I’m doing a loan calculation.

    I do checkouts in many places.
    Installment amount: 5000
    Interest rate: 1%
    Term: 10 Months
    Total loan amount = ? I’m calculating how much should be…

    The result should definitely be 46,728.00 TL.

    I apply these steps to my coding.

    if (fieldname19 === 'B') {
    	var faizOrani = fieldname20 / 100;
    	var aylikFaizOrani = POW(1 + faizOrani, 1 / 12) - 1;
    	var kriter1b = fieldname18 * (POW(1 + aylikFaizOrani, fieldname21) - 1) / aylikFaizOrani;
        jQuery('#calculation-kriter1b').html(kriter1b);
        jQuery('.kriter1-aciklama').html('Kredi Tutar? :');
        jQuery('.kriter1-sonuc').html(kriter1b + ' TL');
    }

    filename20 = Interest rate (%1)
    fieldname18 = Installment Amount (5000 TL)
    fieldname21 = Maturity (10 Months)
    ————————————–

    var aylikFaizOrani = (1 + 0.01)^(1/12) – 1 ≈ 0.0082672412 (This turns out to be wrong.)

    ————————————–
    The result is always wrong.
    Sample Form

    • This topic was modified 1 year, 5 months ago by klingbeil.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @klingbeil

    The calculations performed by the plugin are right, you should check if your formulas are correct. Please, look at the screenshot below. I implemented the mathematical operations in LibreOffice – Excel, and our plugin to allow you comparing results:

    LibreOffice – Excel

    Equation settings.

    The form

    Best regards.

    Thread Starter klingbeil

    (@klingbeil)

    Thanks, this calculation was very difficult, but I finally succeeded..

    There is tr-tr support in dates.. Do numbers, especially amounts, have such a property?

    For example, it writes the result as: 4678.00
    It is 4,678.00 in Turkey.
    Is there any solution to this?
    Thanks

    • This reply was modified 1 year, 5 months ago by klingbeil.
    Thread Starter klingbeil

    (@klingbeil)

    It is?4.678,00?in Turkey. (I typed wrong)

    Plugin Author codepeople

    (@codepeople)

    Hello @klingbeil

    You can enter the comma symbol (,) through the “Decimals separator symbol” attribute in the calculated fields settings and the point (.) in the “Symbol for grouping thousands”.

    Best regards.

    Thread Starter klingbeil

    (@klingbeil)

    did not improve the calculation results. Is there an additional setting?
    I tried everything you said, dot comma. not reflected in the result.

    if (fieldname19 === 'B') {
      var kriter5b = PREC(fieldname25 * fieldname21, 2, true);
      jQuery('#calculation-kriter5b').html(kriter5b);
      jQuery('.kriter5-aciklama').html('Toplam ?denecek Tutar :');
      jQuery('.kriter5-sonuc').html(kriter5b + ' TL');
    }

    Sample

    Plugin Author codepeople

    (@codepeople)

    Hello @klingbeil

    The settings are applied to the equation’s results. But you display the value in a different tag instead of returning the equation result.

    In your case, you must call the FORMAT operation in the “Mathematical Operations” module:

    https://cff.dwbooster.com/documentation#mathematical-module

    var kriter5b = FORMAT(PREC(fieldname25 * fieldname21, 2, true), {groupingsymbol:".", decimalsymbol:","});

    Best regards.

    Thread Starter klingbeil

    (@klingbeil)

    Yes that fixed it thank you.

    But there is one problem..

    Wrote the result: 5.305,02 When I calculate this result with a different fieldname, this time the result gives an error.

    For example: When I multiply 5.305,02 with another fieldname by 10. The result should be 53.305,02 but only 53 gives the result like this

    I used the rules you gave in both cells.

    • This reply was modified 1 year, 5 months ago by klingbeil.
    Thread Starter klingbeil

    (@klingbeil)

    i got it done thanks

    • This reply was modified 1 year, 5 months ago by klingbeil.
    • This reply was modified 1 year, 5 months ago by klingbeil.
    • This reply was modified 1 year, 5 months ago by klingbeil.
    Plugin Author codepeople

    (@codepeople)

    Excellent !!!!

    Best regards.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Calculation Error’ is closed to new replies.