PHP Return
-
Hi there,
This function displays £NaN, is there a way to alter to display N/A or ‘POA’
(function(){
if (fieldname69 == “Bespoke Quote”) return ‘N/A’;
else return
NUMBERFORMAT(fieldname74+fieldname64, ‘GBP’);
})();https://www.ads-software.com/plugins/calculated-fields-form/
Viewing 3 replies - 1 through 3 (of 3 total)
-
Hi,
Could you send me the link to your page to check the version of plugin installed your website, and the fields in the form, please?
Best regards.
Hi,
I’ve visited your page, and the text: Bespoke Quote, was inserted in the equation without quotes, so, Javascript interpret it as a constant. The core equation would be:
(function(){ if (fieldname1 == 60){ if (fieldname3 == 1){ if (fieldname69 == 100) return 65; if (fieldname69 == 250) return 102; if (fieldname69 == 500) return 145; if (fieldname69 == 1000) return 180; if (fieldname69 == 2500) return 225; if (fieldname69 == 5000) return 250; if (fieldname69 == 'Bespoke Quote') return 'N/A'; } if (fieldname3 == 2){ if (fieldname69 == 100) return 80; if (fieldname69 == 250) return 112; if (fieldname69 == 500) return 165; if (fieldname69 == 1000) return 200; if (fieldname69 == 2500) return 300; if (fieldname69 == 5000) return 350; if (fieldname69 == 'Bespoke Quote') return 0; } if (fieldname3 == 3){ if (fieldname69 == 100) return 85; if (fieldname69 == 250) return 112.5; if (fieldname69 == 500) return 190; if (fieldname69 == 1000) return 290; if (fieldname69 == 2500) return 350; if (fieldname69 == 5000) return 450; if (fieldname69 == 'Bespoke Quote') return 0; } if (fieldname3 == 4){ if (fieldname69 == 100) return 100; if (fieldname69 == 250) return 135; if (fieldname69 == 500) return 215; if (fieldname69 == 1000) return 340; if (fieldname69 == 2500) return 425; if (fieldname69 == 5000) return 550; if (fieldname69 == 'Bespoke Quote') return 0; } if (fieldname3 == 5){ if (fieldname69 == 100) return 130; if (fieldname69 == 250) return 162.5; if (fieldname69 == 500) return 250; if (fieldname69 == 1000) return 390; if (fieldname69 == 2500) return 500; if (fieldname69 == 5000) return 650; if (fieldname69 == 'Bespoke Quote') return 0; } } if (fieldname1 == 100){ if (fieldname3 == 1){ if (fieldname69 == 100) return 88; if (fieldname69 == 250) return 120; if (fieldname69 == 500) return 160; if (fieldname69 == 1000) return 200; if (fieldname69 == 2500) return 250; if (fieldname69 == 5000) return 380; if (fieldname69 == 'Bespoke Quote') return 0; } if (fieldname3 == 2){ if (fieldname69 == 100) return 90; if (fieldname69 == 250) return 133; if (fieldname69 == 500) return 180; if (fieldname69 == 1000) return 230; if (fieldname69 == 2500) return 340; if (fieldname69 == 5000) return 490; if (fieldname69 == 0) return 0; } if (fieldname3 == 3){ if (fieldname69 == 100) return 95; if (fieldname69 == 250) return 140; if (fieldname69 == 500) return 210; if (fieldname69 == 1000) return 300; if (fieldname69 == 2500) return 400; if (fieldname69 == 5000) return 600; if (fieldname69 == 0) return 0; } if (fieldname3 == 4){ if (fieldname69 == 100) return 120; if (fieldname69 == 250) return 155; if (fieldname69 == 500) return 240; if (fieldname69 == 1000) return 350; if (fieldname69 == 2500) return 490; if (fieldname69 == 5000) return 700; if (fieldname69 == 0) return 0; } if (fieldname3 == 5){ if (fieldname69 == 100) return 140; if (fieldname69 == 250) return 180; if (fieldname69 == 500) return 285; if (fieldname69 == 1000) return 400; if (fieldname69 == 2500) return 550; if (fieldname69 == 5000) return 800; if (fieldname69 == 0) return 0; } } if (fieldname1 == 140){ if (fieldname3 == 1){ if (fieldname69 == 100) return 95; if (fieldname69 == 250) return 142.5; if (fieldname69 == 500) return 225; if (fieldname69 == 1000) return 220; if (fieldname69 == 2500) return 275; if (fieldname69 == 5000) return 500; if (fieldname69 == 0) return 0; } if (fieldname3 == 2){ if (fieldname69 == 100) return 100; if (fieldname69 == 250) return 162.5; if (fieldname69 == 500) return 265; if (fieldname69 == 1000) return 250; if (fieldname69 == 2500) return 400; if (fieldname69 == 5000) return 600; if (fieldname69 == 0) return 0; } if (fieldname3 == 3){ if (fieldname69 == 100) return 107; if (fieldname69 == 250) return 185; if (fieldname69 == 500) return 305; if (fieldname69 == 1000) return 340; if (fieldname69 == 2500) return 500; if (fieldname69 == 5000) return 750; if (fieldname69 == 0) return 0; } if (fieldname3 == 4){ if (fieldname69 == 100) return 124; if (fieldname69 == 250) return 200; if (fieldname69 == 500) return 350; if (fieldname69 == 1000) return 400; if (fieldname69 == 2500) return 550; if (fieldname69 == 5000) return 900; if (fieldname69 == 0) return 0; } if (fieldname3 == 5){ if (fieldname69 == 100) return 145; if (fieldname69 == 250) return 225; if (fieldname69 == 500) return 385; if (fieldname69 == 1000) return 500; if (fieldname69 == 2500) return 650; if (fieldname69 == 5000) return 1100; if (fieldname69 == 0) return 0; } } if (fieldname2 == 150){ if (fieldname3 == 1){ if (fieldname69 == 100) return 92; if (fieldname69 == 250) return 125; if (fieldname69 == 500) return 140; if (fieldname69 == 1000) return 160; if (fieldname69 == 2500) return 200; if (fieldname69 == 5000) return 300; if (fieldname69 == 0) return 0; } if (fieldname3 == 2){ if (fieldname69 == 100) return 95; if (fieldname69 == 250) return 137.5; if (fieldname69 == 500) return 180; if (fieldname69 == 1000) return 200; if (fieldname69 == 2500) return 275; if (fieldname69 == 5000) return 400; if (fieldname69 == 0) return 0; } if (fieldname3 == 3){ if (fieldname69 == 100) return 100; if (fieldname69 == 250) return 157.5; if (fieldname69 == 500) return 240; if (fieldname69 == 1000) return 310; if (fieldname69 == 2500) return 325; if (fieldname69 == 5000) return 500; if (fieldname69 == 0) return 0; } if (fieldname3 == 4){ if (fieldname69 == 100) return 122; if (fieldname69 == 250) return 175; if (fieldname69 == 500) return 300; if (fieldname69 == 1000) return 380; if (fieldname69 == 2500) return 400; if (fieldname69 == 5000) return 650; if (fieldname69 == 0) return 0; } if (fieldname3 == 5){ if (fieldname69 == 100) return 140; if (fieldname69 == 250) return 200; if (fieldname69 == 500) return 315; if (fieldname69 == 1000) return 420; if (fieldname69 == 2500) return 475; if (fieldname69 == 5000) return 800; if (fieldname69 == 0) return 0; } } if (fieldname2 == 200){ if (fieldname3 == 1){ if (fieldname69 == 100) return 95; if (fieldname69 == 250) return 127.5; if (fieldname69 == 500) return 145; if (fieldname69 == 1000) return 170; if (fieldname69 == 2500) return 250; if (fieldname69 == 5000) return 400; if (fieldname69 == 0) return 0; } if (fieldname3 == 2){ if (fieldname69 == 100) return 99; if (fieldname69 == 250) return 142.5; if (fieldname69 == 500) return 185; if (fieldname69 == 1000) return 220; if (fieldname69 == 2500) return 325; if (fieldname69 == 5000) return 500; if (fieldname69 == 0) return 0; } if (fieldname3 == 3){ if (fieldname69 == 100) return 105; if (fieldname69 == 250) return 175; if (fieldname69 == 500) return 245; if (fieldname69 == 1000) return 320; if (fieldname69 == 2500) return 400; if (fieldname69 == 5000) return 600; if (fieldname69 == 0) return 0; } if (fieldname3 == 4){ if (fieldname69 == 100) return 127; if (fieldname69 == 250) return 192.5; if (fieldname69 == 500) return 305; if (fieldname69 == 1000) return 390; if (fieldname69 == 2500) return 475; if (fieldname69 == 5000) return 700; if (fieldname69 == 0) return 0; } if (fieldname3 == 5){ if (fieldname69 == 100) return 145; if (fieldname69 == 250) return 212.5; if (fieldname69 == 500) return 325; if (fieldname69 == 1000) return 440; if (fieldname69 == 2500) return 525; if (fieldname69 == 5000) return 900; if (fieldname69 == 0) return 0; } } if (fieldname2 == 270){ if (fieldname3 == 1){ if (fieldname69 == 100) return 100; if (fieldname69 == 250) return 130; if (fieldname69 == 500) return 150; if (fieldname69 == 1000) return 180; if (fieldname69 == 2500) return 280; if (fieldname69 == 5000) return 490; if (fieldname69 == 0) return 0; } if (fieldname3 == 2){ if (fieldname69 == 100) return 110; if (fieldname69 == 250) return 150; if (fieldname69 == 500) return 190; if (fieldname69 == 1000) return 250; if (fieldname69 == 2500) return 400; if (fieldname69 == 5000) return 610; if (fieldname69 == 0) return 0; } if (fieldname3 == 3){ if (fieldname69 == 100) return 125; if (fieldname69 == 250) return 190; if (fieldname69 == 500) return 250; if (fieldname69 == 1000) return 340; if (fieldname69 == 2500) return 500; if (fieldname69 == 5000) return 770; if (fieldname69 == 0) return 0; } if (fieldname3 == 4){ if (fieldname69 == 100) return 135; if (fieldname69 == 250) return 210; if (fieldname69 == 500) return 310; if (fieldname69 == 1000) return 400; if (fieldname69 == 2500) return 540; if (fieldname69 == 5000) return 900; if (fieldname69 == 0) return 0; } if (fieldname3 == 5){ if (fieldname69 == 100) return 148; if (fieldname69 == 250) return 230; if (fieldname69 == 500) return 350; if (fieldname69 == 1000) return 500; if (fieldname69 == 2500) return 650; if (fieldname69 == 5000) return 1100; if (fieldname69 == 0) return 0; } } })()
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘PHP Return’ is closed to new replies.