title: Getting the sum of a float of numbers?
body: <p>I have <code>0.0 24.0 0.0 12.0 0.0 0.0 0.0 0.0 0.0</code> how do i get the sum of these values? .sum etc do not work on floats</p>
  
  <p>EDIT:</p>
  
  <p>Im doing</p>
  
  <pre><code>&lt;% @data.each do |data| %&gt;
      &lt;%= data[ :values ]%&gt;
  &lt;%end%&gt;
  </code></pre>
  
  <p>Where <code>data[:values]</code> prints 
  <code>[5.0, 0.0, 0.0, 0.0, 0.0]</code>
  <code>[4.0, 0.0, 0.0, 0.0, 0.0]</code> 
  <code>[1.0, 0.0, 0.0, 0.0, 0.0]</code> 
  and i only want to get the first value of each array and sum them together to get 10.0</p>
  
  <p>@data prints</p>
  
  <pre><code>[{:name=&gt;"BMW", :values=&gt;[0.0, 0.0, 0.0, 0.0, 0.0]}, {:name=&gt;"Asda", :values=&gt;[32.0, 12.0, 0.0, 0.0, 0.0]}]
  </code></pre>