• Resolved Luisle

    (@luisle)


    I set this function:

    (function(){
    if(fieldname1>450000) return 50000*8.5/100;
    if(fieldname1<=450000) AND (fieldname1>400000) return (450000-fieldname1)*8.5/100;
    })();

    The part where i ask about fieldname1 between 400.000 and 450.000 don’t work, i try a lot of different things, but i don’t find the solution because i don’t know what is wrong.

    Regards.

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

    (@codepeople)

    Hello @luisle,

    There are two issues with your equation:

    – First, in javascript the operator that represent the AND is the double symbol: “&&” and not the “AND” word.

    – Second, the use of parentheses is incorrect, you should enclose completely the conditional section of the conditional statement into parenthesis.

    So, the correct equation would be:

    
    (function(){
    if(400000<fieldname1 && fieldname1<=450000) return (450000-fieldname1)*8.5/100;
    if(450000<fieldname1) return 50000*8.5/100;
    })();
    

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘if with and don’t work’ is closed to new replies.