• Resolved dirk93

    (@dirk93)


    Hi,

    I’m trying to add a “+” to the beginning of a string IF the field it is referencing is greater than 0. My formula is below but it always seems to strip the “+”. Does this have to do with the plus sign being a special character?

    IF(fieldname1>0,CONCATENATE(‘+’,fieldname1),fieldname1)

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

    (@codepeople)

    Hello @dirk93

    I don’t know if your copy of the plugin includes the CONCATENATE operation, however, your equation can be implemented as follows:

    
    IF(fieldname1>0,'+'+fieldname1,fieldname1)
    

    Best regards.

    Thread Starter dirk93

    (@dirk93)

    @codepeople thats perfect, thanks! As a follow up question, is there a way to achieve this for a calculated field that serves as an input field?

    For example, if I enter 150 into the field, I would like it to be formatted as +150. If a user enters -150, I would want it to display as -150.

    I saw the __ME__ function but wasn’t able to get it to work. Thanks so much for the assistance!

    Plugin Author codepeople

    (@codepeople)

    Hello @dirk93

    I don’t understand your confusion because the process is the same. I’ll try to describe it with a hypothetical example:

    Assuming the current equation is: fieldname1+fieldname2

    You simply should to edit it as follows:

    
    (function(){
        var result = fieldname1+fieldname2;
        return IF(result>0,'+'+result,result);
    })()
    

    and that’s all.
    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Dynamic Formatting Calculated Field’ is closed to new replies.