3 Replies Latest reply on Feb 19, 2013 9:39 AM by radzmar

    Negative Numbers in calculations

    csb102155 Level 1

      I'm having some problems with getting calculations to show negative numbers.  I have attached a screenshot of what I'm trying to do.  I had a problem with the over/under flow which I solved with the "if" command, but Lines 27 and 28 need to show negative numbers when it calculates.   Can anyone help?

       

      Thanks

      Connie

       

       

      Calculations.png

        • 1. Re: Negative Numbers in calculations
          radzmar Adobe Community Professional & MVP

          Should it dsplay always negative results?

           

          Then use these combined display patterns.

          null{0}|zero{0}|num{'-'z,zzz,zz9.88}
          

           

          To avoid a arithmetic over/underun ensure the calculation does only execute when the input values are not 0.

           

          if (Row25.TonLifeVOC ne 0 and Row24.Match ne 0) then
               Row24.Match / Row25.TonLifeVOC
          endif
          
          • 2. Re: Negative Numbers in calculations
            csb102155 Level 1

            Hi radzmar.  In answer to your question, I need to be able to show negative and positive numbers depending on the data entered.  Right now it only shows positive numbers.  Can I still use what you recommended above or is there another way to show both positive and negative numbers in a calculation based on user input in other fields?

             

            Thanks much for your help.

            • 3. Re: Negative Numbers in calculations
              radzmar Adobe Community Professional & MVP

              Well,

               

              a numeric field generally shows negative values, if the calculated result is less than 0.

               

              Assuming TonLifeVOC is -2 and Match is 10, then the result is -5 and will be displayed in that way.

              The devision has to contain at least one negative value to return a negative result, otherwise it's always positive.