% count = 0 subtotal = 0.0 tax = 0.0 shipping = 0.0 handling = 0.0 discount = 0.0 total = 0.0 @rows.each do |row| count = count + row.count subtotal = subtotal + row.subtotal tax = tax + row.tax shipping = shipping + row.shipping handling = handling + row.handling discount = discount + row.discount total = total + row.total end day_count = @rows.count %>
Total | Daily Average | |
---|---|---|
Count | <%= count %> | <%= sprintf('%.1f', count.to_f / day_count) %> |
Subtotal | $<%= sprintf('%.2f', subtotal ) %> | $<%= sprintf('%.2f', subtotal / day_count) %> |
Tax | $<%= sprintf('%.2f', tax ) %> | $<%= sprintf('%.2f', tax / day_count) %> |
Shipping | $<%= sprintf('%.2f', shipping ) %> | $<%= sprintf('%.2f', shipping / day_count) %> |
Handling | $<%= sprintf('%.2f', handling ) %> | $<%= sprintf('%.2f', handling / day_count) %> |
Discount | $<%= sprintf('%.2f', discount ) %> | $<%= sprintf('%.2f', discount / day_count) %> |
Total | $<%= sprintf('%.2f', total ) %> | $<%= sprintf('%.2f', total / day_count) %> |