• Resolved barnez

    (@pidengmor)


    Hi,

    I’m evaluating this plugin as an alternative to my current calculating form which seems to be somewhat abandoned by the author.

    Although all the required fields are in place (test form), I am starting with a basic calculation where “type of service” (a drop down menu with items assigned the values 0.008 / 0.016 / 0.016 / 0.032 / 0.008 / 0.016) is multiplied by the value inserted into the “number of words” field (field type: number, number format: number).

    In the calculated field output I am using the equation: fieldname5*fieldname7, but regardless of the number value inserted, the output is always: £0.0016

    I’m sure I’m missing something elementary here, but can’t work it out. Any suggestions would be very much appreciated.

    https://www.ads-software.com/plugins/calculated-fields-form/

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

    (@codepeople)

    Hi,

    Please post a support ticket at https://wordpress.dwbooster.com/support

    Thank you!

    Thread Starter barnez

    (@pidengmor)

    Err, this topic is not resolved, so I’m not quite sure why it has been marked so.

    I understand you have a business model which relies on users paying extra for the premium features, and developer support for calculations, but as this is a free support forum, in my view this topic should be left unresolved in the case that another plugin user offers a suggestion here. If I find that I need the premium support, I will open a support ticket as suggested.

    Thanks.

    Thread Starter barnez

    (@pidengmor)

    This has been resolved after rummaging around in the support threads, and is generating the correct output for numbers over 1000.
    The problem was that I hadn’t completed the decimal separator field in field type: number. Once I inserted the sample 32.20, the calculated field generated the correct output.

    Now I’m working on developing the following for higher number ranges, but that is a different story ……:

    (function(){
    if(fieldname7<=5000&&fieldname8==5){
    return (fieldname5*fieldname7*fieldname9)*2;
    }
    
    if(fieldname7<=5000&&fieldname8==4){
    return (fieldname5*fieldname7*fieldname9)*1.5;
    }
    
    if(fieldname7<=5000&&fieldname8==3){
    return (fieldname5*fieldname7*fieldname9)*1;
    }
    
    if(fieldname7<=5000&&fieldname8==2){
    return (fieldname5*fieldname7*fieldname9)*0.95;
    }
    
    if(fieldname7<=5000&&fieldname8==1){
    return (fieldname5*fieldname7*fieldname9)*0.9;
    }
    
    })()

    Plugin Author codepeople

    (@codepeople)

    Hi,

    Please, inserts at least an space character between the conditions and the double ampersand symbol (&&), in the conditional statements.

    Best regards.

    Thread Starter barnez

    (@pidengmor)

    Many thanks for your suggestion. It’s much appreciated.
    I’ll give it a try.

    Thread Starter barnez

    (@pidengmor)

    I have taken your advice and included the spaces around the double ampersand. This works as expected:

    (function(){
    if(fieldname7<=5000 && fieldname8==5){
    return (fieldname5*fieldname7*fieldname9*fieldname17*fieldname10)*2;
    }
    
    })()

    But this does not:

    (function(){
    if(fieldname7>5001 && <=10000 && fieldname8==5){
    return (fieldname5*fieldname7*fieldname9*fieldname17*fieldname10)*3;
    }
    
    })()
    Plugin Author codepeople

    (@codepeople)

    Hi,

    You are not defining correctly the second comparison, you should includes the field you are comparing, the correct would be:

    if(fieldname7>5001 && fieldname7<=10000 && fieldname8==5){

    fieldname7 is bigger than 5001 and fieldname7 is lesser than or equal to 10000

    Best regards.

    Thread Starter barnez

    (@pidengmor)

    Thank you. That has resolved this problem. I am still having some fine tuning issues, which I will email to your support address.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Problems setting up a basic calculation’ is closed to new replies.