• Resolved andrehauge

    (@andrehauge)


    Hi

    We are making a calculation and are stuck with this formula

    (function(){
    if(fieldname49 <= 10) return PREC(fieldname49*313,0);
    if(fieldname49 > 10 < 33) return PREC(fieldname49*223,0);
    if(fieldname49 > 33) return PREC(fieldname49*183,2);
    })();

    Could you please help me?

    André

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

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

    (@codepeople)

    Hello @andrehauge

    The equation can be implemented as follows:

    
    (function(){
    if(fieldname49 <= 10) return ROUND(fieldname49*313);
    if(AND(10<fieldname49, fieldname49<=33)) return ROUND(fieldname49*223);
    return PREC(fieldname49*183,2);
    })();
    

    Best regards.

    Thread Starter andrehauge

    (@andrehauge)

    I tried this one, but it doesnt show the result

    Plugin Author codepeople

    (@codepeople)

    Hello @andrehauge

    You have copied the < and > symbols as html encoded. Please, be sure you have entered the correct symbols.

    Best regards.

    Thread Starter andrehauge

    (@andrehauge)

    this is greek to me. I tried, but messed up.
    Any chance you can mail the code to me andre@apr.as ?

    Plugin Author codepeople

    (@codepeople)

    Hello @andrehauge

    You have entered the code:

    
    (function(){
    if(fieldname49 <= 10) return ROUND(fieldname49*313);
    if(AND(10(fieldname49, fieldname49<=33)) return ROUND(fieldname49*223);
    return PREC(fieldname49*183,2);
    })()
    

    But the correct is:

    
    (function(){
    if(fieldname49 <= 10) return ROUND(fieldname49*313);
    if(AND(10<fieldname49, fieldname49<=33)) return ROUND(fieldname49*223);
    return PREC(fieldname49*183,2);
    })()
    

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘less than X but greater than Y’ is closed to new replies.