1 Reply Latest reply on Apr 9, 2011 7:08 PM by Abhinav Sharma

    Negatives Problem

    david567890

      My problem is that I dont want to have negatives shown. I want WX to show "0" if it is less than 0. Same with XW. Here is the code:

       

       

      TotCos.text = String(x);
                      var w:Number = Number(Sav.text);
                      var wx:Number = w-x
                      var xw:Number = x-w   
                          AmtLeft.text = String(wx);
                          AmtNeed.text = String(xw);
                         
                      if (String (wx < 0))
                          "0"
                     
                      if (String (xw < 0))
                          "0"

       

      Not sure why it isnt working.

       

      Thanks