3 Replies Latest reply on Jan 17, 2009 7:48 AM by [Jongware]

    [JS CS3] Check the pattern of a random number given a specific data ?

    Loic.Aigon Adobe Community Professional
      Hi all,
      I succeed getting a random number of this look : d.dd (8.73 for ex)
      I use Math.random()*(max-min)+min;
      I want to check that this number respect a specific given increment.

      To be clear :
      If I set min to 0 and max to 10 for example.
      The script returns a number like 8.56

      Now, I have a increment like 0.2
      I want the script to give me a number that can be d,d.2,d.4,d.6,d.8
      BUT NOT d.78 or d.1

      I guess I may use a while command but have no idea of the checking operation.
      Any idea ?
      Thanks in advance.