2 Replies Latest reply on Jun 26, 2008 2:35 PM by Gregory Lafrance

    Flex calculation error, please help

    Doc816
      I want to perform simple calculation on two variables as such:

      var a:String = "1.025";
      var b:String = "1.022";

      var c: String = ( a - b ) * 10000;

      For some reason variable c now hold "29.999999999998916" instead of 30.

      I am using strings because that is what is returned from a remote script via httpservice. I understand that Flex/Flash convert any String to Number when used in an expression for calculation. What is going on here?