ruby array sum sample
simple sample
1 # an array with numbers 2 orders = %w(10 11.5 1.5 24 100) 3 4 # convert array to float (originally in string format) 5 orders.map!{ |order| order.to_f } 6 7 total = orders.inject() {|result, element| result + element}