12 Replies Latest reply on Nov 24, 2007 11:55 AM by kglad

    AS 2 - From String to Number conversion Anomaly

    Giò

      There is some strange behavior into Flash subsystem about String --> Number conversion

      Execute this simple code.


      var strAux:String="1.15";
      if(!isNaN(strAux)){
      if(Number(strAux)>1.15){
      trace("Error. This condition must be false")
      }
      //There is some sub system problem and I search it
      if(Number(strAux)>=1.15000000000000001 && Number(strAux)<=1.15000000000000009){
      trace("Range of problem")
      }
      //Illogical cases
      if(Number(strAux)==1.15000000000000003){
      trace("Correct digit found case 1")
      }
      if(Number(strAux)==1.15000000000000004){
      trace("Correct digit found case 2")
      }
      if(Number(strAux)==1.15000000000000005){
      trace("Correct digit found case 3")
      }
      }else{
      trace("Please assign 1.15")
      }