• Resolved arkzane

    (@arkzane)


    Hi,

    I get confused why the calculator doesn’t work when I’m trying to enter this formula

    ((function(){
    if(fieldname8< 7,850,000) return fieldname8*2.22;
    if(fieldname8=7,850,000) return fieldname8*2;
    if(fieldname8>7,850,000) return fieldname8*2;
    })()

    I am trying to make a condition if the user results in fieldname8 below than 7,85 million then the fieldname8 would times by 2.22 to be shown in the fieldname 9 as a result.

    if anyone can help me that would be great. Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter arkzane

    (@arkzane)

    Still need to fix this issue soon

    Plugin Author codepeople

    (@codepeople)

    Hello @arkzane

    There are some issues in your equation:

    * In javascript you cannot use the thousands separator symbols in the numbers,
    * The operator for equality is double symbol “==” because the symbol “=” is used for assignment.
    * There is an extra open parenthesis “(”
    * Finally, the last conditional statement is unneeded.

    So, the equation would be:

    
    (function(){
    if(fieldname8 <7850000) return fieldname8*2.22;
    if(fieldname8 == 7850000) return fieldname8*2;
    return fieldname8*2;
    })()
    

    Best regards.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘If statement calculator’ is closed to new replies.