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

    (@codepeople)

    Hi,

    The comparison symbol is “>=” and not “=>”, furthermore, there is an inconsistency in your equation, for fieldname1 equal to 10000 the operation executed would be always the first one, so the equality in the second conditional statement has not sense. The equations above are equivalents to:

    (function(){
    var f1 = fieldname1;
    if(fieldname1 < 10000) return f1 * 0.05;
    return f1 * 0.02;
    })();

    IF(fieldname1<10000, fieldname1*0.05, fieldname1*0.02)

    fieldname1*((fieldname1<10000)?0.05:0.02)

    In reality there are more variants.

    Best regards.

    Thread Starter priyadilsha

    (@priyadilsha)

    Hi,

    sorry. my mistake. Thank you very much for the help!
    Awesome plugin and good luck.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘javascript equation not working’ is closed to new replies.