Change color when the sum is negative

[ad_1]

Hello @thierrylarrue

Thank you very much for using our plugin. Yes, that’s possible. I’ll try to describe the process with a hypothetical example.

Assuming you have the calculated field fieldname3 with the equation fieldname1-fieldname2

To display the equation’s results in green color for values greater than or equal to 0 and red otherwise, you can edit the equation as follows:


(function(){
var result = fieldname1-fieldname2,
    color = IF(0 <= result, 'green', 'red');

getField(fieldname3|n).jQueryRef().find('input').css('color', color);

return result;
})()

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer