1 Reply Latest reply on Oct 5, 2010 9:04 PM by BhaskerChari

    How to manipulate numbers?

    bryant_16 Level 1

      Lets say I have this number: 1108843.18150425 and I want to divide it by 1000000, how to return the result as 1.1088 instead of 1 which is returning to me as of now?

        • 1. Re: How to manipulate numbers?
          BhaskerChari Level 4

          Hi Bryant,

           

          You can use Number datatype for this..instead of int..I think you might be using.

           

           

           

          var num1:Number = 1108843.18150425;

           

          var num2:Number = 1108843.18150425/1000000;

           

           

          If you want to round it to 4 points after decimal use the below one..

           

          var num1:Number = 1108843.18150425;

           

          var num2:Number = Number((1108843.18150425/1000000).toFixed(4));

           

           

          Thanks,

          Bhasker