6 Replies Latest reply on Feb 26, 2007 6:30 PM by kglad

    ignoring 0's at end of numbers

    twistedpancreas
      hi there,

      i've got a variable called solutionAnswer which has a value of 0.02500.

      The user has to write this EXACT number into a text box called "solution" and then be checked by Flash after clicking a button called "onCheck".

      I have tried this

      solutionAnswer = "0.02500";
      // i've also tried this solutionAnswer = 0.025+"00";

      onCheck.onPress = function() {

      var Answer:Number = 0;

      if (Number(solutionAnswer) == Number(solution.text))

      Answer = 1;

      if (Answer == 1) {
      gotoAndStop(2);

      } else {
      gotoAndStop(3);
      }
      };


      Problem is the answer 0.025 is coming up as correct, when the only correct answer should be 0.02500 (ie including the two 0's at the end of the number)

      Can anyone help,

      thanks in advance.