3 Replies Latest reply on Aug 8, 2007 4:41 AM by Newsgroup_User

    float AND/OR value

    BigDaddy Level 1
      Hi

      I need to express the following...

      100 * (6/(42 * 7 * 8))
      one hundred times (six divided by (the sum of 42 times seven times eight))

      I tried float and value to no avail.

      Thanks
        • 1. Re: float AND/OR value
          Level 7
          Try this:

          100 * (6/(42 * 7 * 8.0))

          I forced Director to acknowledge that it is a float by adding the '.0'
          at the end. Following the standard mathematical order of operations,
          the 1st thing that is done is the 42*7*8. Since it is a float (once I
          added the .0), Director will treat it as a float then divided into 6 and
          when multiplied by 100.
          • 2. Re: float AND/OR value
            BigDaddy Level 1
            Hi

            I didn't think to add a decimal pt AT ALL!!

            Thanks
            • 3. Re: float AND/OR value
              Level 7
              You can also use the float function to make it more conspicuous in your
              code.

              float (5) = 5.0000

              You'll get as many zeros as "the floatPrecision" indicates. Its default is
              4 places. But of course that's true when using just a decimal as well.

              --
              Craig Wollman
              Lingo Specialist
              Word of Mouth Productions
              212-928-9581

              www.wordofmouthpros.com
              "BigDaddy" <webforumsuser@macromedia.com> wrote in message
              news:f9aeo2$4pr$1@forums.macromedia.com...
              > Hi
              >
              > I didn't think to add a decimal pt AT ALL!!
              >
              > Thanks