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

    (@codepeople)

    Hi,

    In this case the equation would be:

    (function(){
    if( 1 <= fieldname1 && fieldname1 <= 10 ) return 141.65;
    else return 1000;
    })()

    Best regards.

    Thread Starter WillBigGun

    (@willbiggun)

    Hi there,

    We cant seem to display the vallue with the code below

    (function(){
    if (fieldname65 == “0.5mm Stainless Steel”){
    if (fieldname3 == “1”){
    if (fieldname50 == 100 && fieldname56 > 1198 && fieldname56 < 1400) return “154.52”;
    if (fieldname50 == 100 && fieldname56 > 1401 && fieldname56 < 1875) return “156.73”;
    if (fieldname50 == 200 && fieldname56 > 1198 && fieldname56 < 1400) return “185.28”;
    if (fieldname50 == 200 && fieldname56 > 1401 && fieldname56 < 1875) return “192.92”;
    if (fieldname50 == 200 && fieldname56 > 1876 && fieldname56 < 2848) return “247.30”;
    if (fieldname50 == 400 && fieldname56 > 1401 && fieldname56 < 1875) return “294.11”;
    if (fieldname50 == 400 && fieldname56 > 1876 && fieldname56 < 2848) return “393.85”;
    if (fieldname50 == 400 && fieldname56 > 2849 && fieldname56 < 4400) return “471.02”;
    if (fieldname50 == 400 && fieldname56 > 4401 && fieldname56 < 5016) return “626.81”;
    if (fieldname50 == 500 && fieldname56 > 1876 && fieldname56 < 2848) return “477.19”;
    if (fieldname50 == 500 && fieldname56 > 6251 && fieldname56 < 8820) return “1077.44”;
    if (fieldname50 == 500 && fieldname56 > 8821 && fieldname56 < 11250) return “1153.88”;
    }

    if(fieldname3 == “2”){
    if (fieldname50 == 100 && fieldname56 > 1198 && fieldname56 < 1400) return “287.20”;
    if (fieldname50 == 100 && fieldname56 > 1401 && fieldname56 < 1875) return “294.84”;
    if (fieldname50 == 400 && fieldname56 > 4401 && fieldname56 < 5016) return “946.40”;
    if (fieldname50 == 400 && fieldname56 > 5017 && fieldname56 < 6250) return “1037.40”;
    if (fieldname50 == 400 && fieldname56 > 6251 && fieldname56 < 8820) return “1351.90”;
    if (fieldname50 == 400 && fieldname56 > 8821 && fieldname56 < 11250) return “1508.42”;
    if (fieldname50 == 500 && fieldname56 > 5017 && fieldname56 < 6250) return “1233.96”;
    if (fieldname50 == 500 && fieldname56 > 6251 && fieldname56 < 8820) return “1628.90”;
    if (fieldname50 == 500 && fieldname56 > 8821 && fieldname56 < 11250) return “1821.82”;
    }
    }

    if (fieldname65 == “0.5mm Aluminium” && fieldname65 == “1mm Aluminium”){
    if(fieldname3 == “1”){
    if (fieldname50 == 100 && fieldname56 > 1 && fieldname56 < 494) return “141.65”;
    if (fieldname50 == 200 && fieldname56 > 1 && fieldname56 < 494) return “141.65”;
    if (fieldname50 == 200 && fieldname56 > 2849 && fieldname56 < 4400) return “1248”;
    if (fieldname50 == 300 && fieldname56 > 1 && fieldname56 < 494) return “3000”;
    if (fieldname50 == 400 && fieldname56 > 1 && fieldname56 < 494) return “2600”;#
    }
    if(fieldname3 == “2”){
    if (fieldname50 == 100 && fieldname56 > 1 && fieldname56 < 494) return “20000”;
    }
    }
    })();

    Any thoughts?

    Plugin Author codepeople

    (@codepeople)

    Hi,

    The numbers are extracted from the text values. So, in the following conditional statements:

    if (fieldname65 == “0.5mm Stainless Steel”)

    if (fieldname65 == “0.5mm Aluminium” && fieldname65 == “1mm Aluminium”)

    Use directly the numbers:

    if (fieldname65 == 0.5)

    if (fieldname65 == 0.5 && fieldname65 == 1)

    Furthermore, pay attention to the second conditional statement:

    if (fieldname65 == 0.5 && fieldname65 == 1)

    fieldname65 cannot satisfy to the same time both conditions.

    Best regards.

    Thread Starter WillBigGun

    (@willbiggun)

    Hi there,

    How would I do an ‘or’ statement then for

    if (fieldname65 == 0.5 && fieldname65 == 1) {

    Thread Starter WillBigGun

    (@willbiggun)

    fieldname65 is a Dropdown field type

    Plugin Author codepeople

    (@codepeople)

    Hi,

    In javascript the “or” operator is represented by the symbol: ||

    if (fieldname65 == 0.5 || fieldname65 == 1)

    Best regards.

    Thread Starter WillBigGun

    (@willbiggun)

    This code is not returning a zero (function(){

    if (fieldname50 == “”) return 0;
    else return NUMBERFORMAT(fieldname68/fieldname50, ‘GBP’);

    })();

    it is returning NaN

    Any suggestion?

    Thread Starter WillBigGun

    (@willbiggun)

    This code is not returning a zero (function(){

    if (fieldname50 == “”) return 0;
    else return NUMBERFORMAT(fieldname68/fieldname50, ‘GBP’);

    })();

    it is returning NaN

    Any suggestion?

    Plugin Author codepeople

    (@codepeople)

    Hi,

    If you’re using the NUMBERFORMAT operation is because you have installed the Developer version of the plugin.

    Could you open a ticket in our support page for questions related with the paid versions of the plugin, please?

    https://wordpress.dwbooster.com/support

    Note: Remember to include in the ticket, the URL to the webpage where the form was published.

    Thank for understanding.
    Best regards.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘if inbetween value’ is closed to new replies.