title: Cannot convert from float to int
body: <p>I have some code like this:</p>
  
  <pre><code>void drawPlot()
  {
      String[] dataItemPrices = loadStrings("itemPrices.csv");  //load in .csv file, store as string array
      itemName = new String[dataItemPrices.length-1];
      itemPrice = new float[dataItemPrices.length-1];
  
      for (int i=0; i&lt;dataItemPrices.length-1; i++) 
      {
          //split array to consider commas
          String[] tokensItemPrices = dataItemPrices[i+1].split(",");   
          itemName[i] = tokensItemPrices[0];
          itemPrice[i] = Float.parseFloat(tokensItemPrices[1]);
  
          dataMin = min(dataMin,itemPrice[i]); 
          dataMax = max(dataMax,itemPrice[i]); 
  
          itemPriceScaled = new float[map(itemPrice[i], dataMin, dataMax, 
                                          0, (height-100))];
      }
  }
  </code></pre>
  
  <p>The last line of code is causing problems, when I compile I get "cannot convert from float to int".</p>
  
  <p>The only int is the [i] but that's used to access an array, it can't be that can it? Otherwise how can I access the array?</p>
  
  <p>Help please!</p>
  
  <p>Thanks!</p>