Graphics

 View Only
Expand all | Collapse all

Adding a plus or minus sign to a result in Vlogic (or by some other means

  • 1.  Adding a plus or minus sign to a result in Vlogic (or by some other means

    Posted 06-10-2015 15:10
    Hi gang,

    I have some datalinqed numbers subtracting to give me a final result. ie -20 or +20.

    If I get a negative result I automatically get a minus sign in front of the numbers.

    Is there a way I can get a "plus +" sign to appear in front of the numbers when I get a positive result?

    It's for a sports feed, and the client would really like to see the negative or positive shown.

    I have been experimenting in Vlogic, but haven't been able to work it out.

    Perhaps there is a script i could use.

    Just to clarify, I have two numbers being pulled from a data feed, and then one is subtracted from the other to create a result text.

    cheers

    scott


  • 2.  RE: Adding a plus or minus sign to a result in Vlogic (or by some other means

    Posted 06-10-2015 20:09
    On the text object, edit the script for OnSetText to:

    if CInt(text)>0 then text=Chr(43) & text

    If you want a space between them:

    if CInt(text)>0 then text=Chr(43) & " " & text

    EDIT: This will not work for values between 0 and 0.5. For that, instead of `CInt`, use `CSng`.

    #XPression