Commit 118bd2b0 authored by Cecilia Nievas's avatar Cecilia Nievas
Browse files

added comma to separate thousands in the format of numbers printed to screen/logs

parent 68c3b25b
......@@ -192,16 +192,16 @@ def run_this_file(config_dict):
string= ' Occupancy: '+case
print(string)
out_csv.write(string+'\n')
string= ' Total number of buildings: '+'{:.2f}'.format(tot_num_bdgs[case_pos])
string= ' Total number of buildings: '+'{:,.2f}'.format(tot_num_bdgs[case_pos])
print(string)
out_csv.write(string+'\n')
string= ' Total number of dwellings: '+'{:.2f}'.format(tot_num_dwells[case_pos])
string= ' Total number of dwellings: '+'{:,.2f}'.format(tot_num_dwells[case_pos])
print(string)
out_csv.write(string+'\n')
string= ' Total number of people: '+'{:.2f}'.format(tot_num_ppl[case_pos])
string= ' Total number of people: '+'{:,.2f}'.format(tot_num_ppl[case_pos])
print(string)
out_csv.write(string+'\n')
string= ' Total cost: '+'{:.2f}'.format(tot_cost[case_pos])
string= ' Total cost: '+'{:,.2f}'.format(tot_cost[case_pos])
print(string)
out_csv.write(string+'\n')
out_csv.close()
......
......@@ -94,8 +94,8 @@ def run_this_file(config_dict):
print(' ERROR!! CELL ID '+str(cell_id)+' FOUND MORE THAN ONCE IN VISUAL OUTPUT CSV!!!')
row_read[which]= True
print('\n')
print('Total cost OQ: '+'{:.2f}'.format(full_cost_oq))
print('Total cost visual: '+'{:.2f}'.format(full_cost_visual))
print('Total cost OQ: '+'{:,.2f}'.format(full_cost_oq))
print('Total cost visual: '+'{:,.2f}'.format(full_cost_visual))
print('\n')
print('Done!')
......
......@@ -206,28 +206,28 @@ def run_this_file(config_dict):
out_csv.close()
print('\n')
out_csv= open(os.path.join(out_path, 'rebuilding_SERA', 'rebuilding_SERA_alt_01_'+country_name+'_'+case+'_'+param_for_weighting+'_print_screen.txt'), 'w')
string= ' Total number of buildings from SERA CSV files: '+'{:.4f}'.format(sera_num_bdgs_country)
string= ' Total number of buildings from SERA CSV files: '+'{:,.4f}'.format(sera_num_bdgs_country)
print(string)
out_csv.write(string+'\n')
string= ' Total number of buildings from cells summation: '+'{:.4f}'.format(per_admin_unit_num_bdgs_derived.sum())
string= ' Total number of buildings from cells summation: '+'{:,.4f}'.format(per_admin_unit_num_bdgs_derived.sum())
print(string)
out_csv.write(string+'\n')
string= ' Total number of dwellings from SERA CSV files: '+'{:.4f}'.format(sera_num_dwells_country)
string= ' Total number of dwellings from SERA CSV files: '+'{:,.4f}'.format(sera_num_dwells_country)
print(string)
out_csv.write(string+'\n')
string= ' Total number of dwellings from cells summation: '+'{:.4f}'.format(per_admin_unit_num_dwells_derived.sum())
string= ' Total number of dwellings from cells summation: '+'{:,.4f}'.format(per_admin_unit_num_dwells_derived.sum())
print(string)
out_csv.write(string+'\n')
string= ' Total number of people from SERA CSV files: '+'{:.4f}'.format(sera_num_ppl_country)
string= ' Total number of people from SERA CSV files: '+'{:,.4f}'.format(sera_num_ppl_country)
print(string)
out_csv.write(string+'\n')
string= ' Total number of people from cells summation: '+'{:.4f}'.format(per_admin_unit_num_ppl_derived.sum())
string= ' Total number of people from cells summation: '+'{:,.4f}'.format(per_admin_unit_num_ppl_derived.sum())
print(string)
out_csv.write(string+'\n')
string= ' Total cost of buildings from SERA CSV files: '+'{:.4f}'.format(sera_repl_cost_country)
string= ' Total cost of buildings from SERA CSV files: '+'{:,.4f}'.format(sera_repl_cost_country)
print(string)
out_csv.write(string+'\n')
string= ' Total cost of buildings from cells summation: '+'{:.4f}'.format(per_admin_unit_repl_cost_derived.sum())
string= ' Total cost of buildings from cells summation: '+'{:,.4f}'.format(per_admin_unit_repl_cost_derived.sum())
print(string)
out_csv.write(string+'\n')
print('\n')
......
......@@ -203,28 +203,28 @@ def run_this_file(config_dict):
out_csv.close()
print('\n')
out_csv= open(os.path.join(out_path, 'rebuilding_SERA', 'rebuilding_SERA_alt_02_'+country_name+'_'+case+'_'+param_for_weighting+'_print_screen.txt'), 'w')
string= ' Total number of buildings from SERA CSV files: '+'{:.4f}'.format(sera_num_bdgs_country)
string= ' Total number of buildings from SERA CSV files: '+'{:,.4f}'.format(sera_num_bdgs_country)
print(string)
out_csv.write(string+'\n')
string= ' Total number of buildings from cells summation: '+'{:.4f}'.format(per_admin_unit_num_bdgs.sum())
string= ' Total number of buildings from cells summation: '+'{:,.4f}'.format(per_admin_unit_num_bdgs.sum())
print(string)
out_csv.write(string+'\n')
string= ' Total number of dwellings from SERA CSV files: '+'{:.4f}'.format(sera_num_dwells_country)
string= ' Total number of dwellings from SERA CSV files: '+'{:,.4f}'.format(sera_num_dwells_country)
print(string)
out_csv.write(string+'\n')
string= ' Total number of dwellings from cells summation: '+'{:.4f}'.format(per_admin_unit_num_dwells.sum())
string= ' Total number of dwellings from cells summation: '+'{:,.4f}'.format(per_admin_unit_num_dwells.sum())
print(string)
out_csv.write(string+'\n')
string= ' Total number of people from SERA CSV files: '+'{:.4f}'.format(sera_num_ppl_country)
string= ' Total number of people from SERA CSV files: '+'{:,.4f}'.format(sera_num_ppl_country)
print(string)
out_csv.write(string+'\n')
string= ' Total number of people from cells summation: '+'{:.4f}'.format(per_admin_unit_num_ppl.sum())
string= ' Total number of people from cells summation: '+'{:,.4f}'.format(per_admin_unit_num_ppl.sum())
print(string)
out_csv.write(string+'\n')
string= ' Total cost of buildings from SERA CSV files: '+'{:.4f}'.format(sera_repl_cost_country)
string= ' Total cost of buildings from SERA CSV files: '+'{:,.4f}'.format(sera_repl_cost_country)
print(string)
out_csv.write(string+'\n')
string= ' Total cost of buildings from cells summation: '+'{:.4f}'.format(per_admin_unit_repl_cost.sum())
string= ' Total cost of buildings from cells summation: '+'{:,.4f}'.format(per_admin_unit_repl_cost.sum())
print(string)
out_csv.write(string+'\n')
print('\n')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment