• Resolved alvin325

    (@alvin325)


    Hi. Thanks for the great plugin. I wonder if you can help me out with a formula for these statements: If the price is greater than 100 but lower than 300 the fee is 2.67.

    And joining that statement with another one which says: if the price is greater than 301 but lower than 600 the fee is 1.97.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @alvin325

    I’ll assume the price is entered or calculated through the fieldname1 field to describe the process.

    Insert a calculated field in the form with the following equation:

    
    (function(){
    if(100<fieldname1 && fieldname1 <= 300) return 2.67;
    if(300<fieldname1 && fieldname1 <= 600) return 1.97;
    })()
    

    Note that your equation’s description does not cover the cases where the value of the fieldname1 field is less than or equal to 100, or great than 600.

    Best regards.

    Thread Starter alvin325

    (@alvin325)

    Thanks for your prompt response. However when I put that equation the preview of the form is no longer showing. The page is no longer fully loading and it doesn’t show any calculator but when I remove the equation it will start to load and show the calculator. What could be the problem?

    Plugin Author codepeople

    (@codepeople)

    Hello @alvin325

    The equation was only an example to teach you the use of the conditional statements in the equations. I don’t sent you it for copy/paste. I even don’t know the structure and names of your form’s fields. So, you should adjust the example to your project.

    If you need additional support, indicate the URL to the page where the form is inserted.

    Best regards.

    Thread Starter alvin325

    (@alvin325)

    Okay thanks. The url is https://cashtalk.co.zw/testing

    Plugin Author codepeople

    (@codepeople)

    Hello @alvin325

    But please, if you need my help, you should describe the equation needed based on the fields in the form.

    Best regards.

    Thread Starter alvin325

    (@alvin325)

    Understood. The first field labeled “Send” is fieldname2 and the second field labeled “Fee” is fieldname1.

    I need an equation for this statement:If the amount sent (fieldname2) is greater than 100 but lower than 300 the fee (fieldname1) is 2.67. And if the amount sent (fieldname2) is greater than 301 but lower than 600 the fee(fieldname2) is 1.97.

    Plugin Author codepeople

    (@codepeople)

    Hello @alvin325

    In this case, the equation to calculate the fee would be the same described previously, but the field to check would be the fieldname2:

    
    (function(){
    if(100<fieldname2 && fieldname2 <= 300) return 2.67;
    if(300<fieldname2 && fieldname2 <= 600) return 1.97;
    })()
    

    Best regards.

    Thread Starter alvin325

    (@alvin325)

    Alright thanks for helping out 😊.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Need help with IF argument’ is closed to new replies.