result ="" sqft =0 result="" sqft=0 v=$tree['rooms'].values.sort_by {|h| [ h['floor_number'],h['room_name'] ]}.each_with_index do |val,index| s= (index+1).to_s if ( val['conditioned'] && val['type_name'] != 'Open Below') result += " " + s +"\t" + val['room_name'].to_s + " \t" + val['floor_number'].to_s + " \t" +val["internal_area"].round(0).to_s + " sq ft\n" sqft +=val["internal_area"].round(0) end end result += "Totals: \t\t\t" +sqft.to_s + " sq ft \n" result