• Resolved 1zooza

    (@1zooza)


    Hello,

    I need to make a commission calculator, but I am not sure if there is a way how to make such a condition:

    The problem is that the percentage amount of the commission changes depending on the amount.

    If the amount is up to 19,999 CZK, the commission is 30% of the amount (in CZK).
    If the amount is 20,000 – 59,999 CZK, the commission is 25% of the amount (in CZK).
    If the amount is between 60,000-299,999, the commission is 20% of the amount (in CZK).
    If the amount is 300,000 CZK and above, the commission is 15% of the amount (in CZK).

    I would like the commission calculation in CZK to be displayed in fieldname4. In fieldname2 there can be adjusted amount of CZK.

    Is it possible to set such a condition for calculation? I am attaching a printscreen of the form, also the form can be seen here: https://adost.setvori.cz/?cff-form=5

    Thank you very much for your advise
    Zuzana

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter 1zooza

    (@1zooza)

    Here is the printscreen: https://snipboard.io/n5HQ4x.jpg

    Plugin Author codepeople

    (@codepeople)

    Hello @1zooza

    Thank you very much for using our plugin.

    I’ll try to describe the process with a hypothetical example.

    Assuming the amount is entered through the currency field fieldname1, you can insert a calculated field in the form and enter the following code as its equation:

    IF(fieldname1<=19999, 30, IF(fieldname1<=59999, 25, IF(fieldname1<=299999, 20, 15)))/100*fieldname1

    You can implement the equation by using function structure:

    (function(){
        var c;
    
        if(fieldname1<=19999) c=30;
        else if(fieldname1<=59999) c=25;
        else if(fieldname1<=299999) c=20;
        else c = 15;
    
        return c/100*fieldname1;
    })()

    Best regards.

    Thread Starter 1zooza

    (@1zooza)

    It works, thank you so much! ??
    Zuzana

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Help with conditioned counting’ is closed to new replies.