4 Replies Latest reply on Jan 26, 2010 12:54 PM by msakrejda

    Need help with simple list of numbers issue

    cheftimo Level 2

      I have an ArrayCollection, one of whose columns is a price:Number. I want to get the max() and min() prices from that column. I created a temporary array that just contains the prices; it looks like this:

       

      temp = Array()

      [0] = 13.95

      [1] = 32.50

      [2] = 23.45 … etc

       

      When I attempt to pass the array to max() like this, Math.max(temp), I get an error message about coercing Array to Number.

       

      The temp array does contain the correct data. How do I turn it into a list of values that the Math.min() and max() methods will accept?

       

      Any ideas? Thanks,

       

      Carlos