• Resolved dankarr

    (@dankarr)


    (function(){
        if(fieldname3=85)
        {
           return (((fieldname10-fieldname18)*600)+(((fieldname10-fieldname18)*fieldname33)*0.115));
        }
        else
        {
            return filename18;
        }
    })()
    
    What is wrong with this code. On the URL page you will see the calculator this is applied to. The box at the bottom that says "Your first year profit increase..." is where this should insert a number. 

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

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

    (@codepeople)

    Hello @dankarr

    Thank you very much for using our plugin. In Javascript, the equality operator is the double symbol ==. The single symbol = is used for assignment.

    So, the equation would be:

    (function(){
        if(fieldname3==85)
        {
           return (fieldname10-fieldname18)*600+(fieldname10-fieldname18)*fieldname33*0.115;
        }
        else
        {
            return filename18;
        }
    })()

    Note that you can use the IF operation in this case and make the equation simpler:

    IF(fieldname3==85, (fieldname10-fieldname18)*600+(fieldname10-fieldname18)*fieldname33*0.115, filename18)
    

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Using IF statements’ is closed to new replies.