• Resolved amitramani

    (@amitramani)


    Hello
    I am interested in knowing if this plugin can help me calculate a Size (XS, Small, Medium, large etc) based on 4 different body measurements.

    I tried using the Advanced Equations Editor, but can not get it to work.

    Is this possible?
    Thanks in advance!

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @amitramani

    Yes, of course. However, the implementation of the equation depends on the formula. I’ll try to describe the process with a hypothetical example:

    Assuming you have two number fields in the form: A (fieldname1) and B (fieldname2), and you want to return the letters: w, x, y, or z based on the values of the number fields.

    If A is between 0 and 10, and B between 0 and 10, return W
    If A is between 10 and 100, and B between 0 and 10, return X
    If A is between 0 and 10, and B between 10 and 100, return Y
    If both, A and B are between 10 and 100, return Z
    If any of them is greater than 100, return Error

    In this hypothetical example the equation would be similar to:

    
    (function(){
        if(AND(fieldname1<10, fieldname2<10)) return 'W';
        if(AND(fieldname1<=100, fieldname2<10)) return 'X';
        if(AND(fieldname1<10, fieldname2<=100)) return 'Y';
        if(AND(fieldname1<=100, fieldname2<=100)) return 'Z';
        return 'Error';
    })()
    

    Your equation could be similar but with more variables and probably some mathematical operations. The equation above shows you the use of conditional statements.

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘How to calculate size from 4 numeric fields’ is closed to new replies.