WordPress.org

Ready to get started?Download WordPress

Forums

Calculated Fields Form
[resolved] Formula works and doesn't (2 posts)

  1. flabrea
    Member
    Posted 5 months ago #

    Hi guys,

    something strange in my formula?! It works as soon as the entered value is smaller than 0.1 or larger than 1. For every value in fieldname113 between 0.1 and 0.99999999 i do not get a result?! why is that?

    (function(){
    if(fieldname111 == 0) return 0;
    if(fieldname111 == 1 && fieldname113 <= 0.1) return (40*fieldname63*fieldname11+80);
    if(fieldname111 == 1 && fieldname113 >> 0.1) return fieldname113*100*4*fieldname11*fieldname63+80;
    })()

    thanks for your help!

    https://wordpress.org/plugins/calculated-fields-form/

  2. codepeople
    Member
    Plugin Author

    Posted 5 months ago #

    The symbols for comparissions are:

    <, >, ==, <=, >=, !=

    So the correct would be:

    (function(){
    if(fieldname111 == 0) return 0;
    if(fieldname111 == 1 && fieldname113 <= 0.1) return (40*fieldname63*fieldname11+80);
    if(fieldname111 == 1 && fieldname113 > 0.1) return fieldname113*100*4*fieldname11*fieldname63+80;
    })()

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.