BathHacked/energy-sparks

View on GitHub
app/views/comparisons/thermostatic_control/_table.csv.ruby

Summary

Maintainability
Test Coverage
CSV.generate do |csv|
  # headers
  csv << @headers
  @results.each do |result|
    csv << [
      result.school.name,
      format_unit(result.r2, Float , true, :benchmark),
      format_unit(result.potential_saving_gbp, Float, true, :benchmark)
    ]
  end
end.html_safe