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