1 Reply Latest reply on May 24, 2006 5:32 AM by Sivakanesh

    Addition

    Tolk
      ok if i have a group of input text box variables, say test1 test2 test 3....
      and i have another dynamic text box variable, say total
      and i use the action script total = test1+test2+test3....
      Instead of adding the numbers stored in the input text boxes it adds them together as a string i.e: 1+2+3+4 = 1234
      I understand why it's doing this but how do i override this so it takes the strings as numbers?
      Hopefully a simple question to awnser!
      Thanks!
      P.s. the numbers entered won't always be integer
        • 1. Re: Addition
          Sivakanesh
          If textbox1 has a value of 1 and textbox2 has a value of 2.235 then to add it you will do as follows;

          total = Number(textbox1.text)+Number(textbox2.text);
          The total will now be 3.235.